[PATCH], PR 71805, Fix PowerPC ISA 3.0 xxperm/xxpermr usage

2016-07-11 Thread Michael Meissner
When I initially implemented the xxperm support in the ISA 3.0 extensions, I misread the manual. The xxperm (and xxpermr) instruction logically should have 4 arguments, like vperm/vpermr (ouput, 2 inputs that provide the bytes, and the permute register), but due to encoding issues, it only has 3 V

Re: [PATCH] disable IPA-cp cloning for functions with target_clones attribute

2016-07-11 Thread Evgeny Stupachenko
PING. On Fri, Jun 24, 2016 at 1:41 PM, Evgeny Stupachenko wrote: > Hi, > > Fix ICE when IPA-cp and target_clones are applied to the same function. > Is the patch ok for trunk? > > Thanks, > Evgeny > > 2016-06-24 Evgeny Stupachenko > > gcc/ > * ipa-cp.c (determine_versionability): Do no

[patch, fortran] PR66310 Problems with intrinsic repeat for large number of copies

2016-07-11 Thread Jerry DeLisle
Attached patch sets a limit of huge-1 on the character count to avoid the integer wrap. Regression tested with adjustment to test case. OK for trunk? Regards, Jerry 2016-07-11 Jerry DeLisle PR fortran/66310 * simplify.c (gfc_simplify_repeat): Set max repeat to huge - 1 to a

Re: [libiberty][PATCH] Avoid zero-length VLAs.

2016-07-11 Thread Brooks Moses
On Mon, Jul 11, 2016 at 4:27 PM, Ian Lance Taylor wrote: > On Mon, Jul 11, 2016 at 1:05 PM, Brooks Moses wrote: >> Ping? > > This is fine, but please add a comment explaining why the code avoids > 0-length VLAs. Thanks. Thanks! Committed as r238233. This is the comment I added: +/* Avoid

Re: [patch] Fix type merging deficiency during WPA

2016-07-11 Thread Jan Hubicka
> > So something akin to what I initially proposed? > https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00182.html I have similar patch to add_expr. I don't think it should have flag_wpa guard: other FEs are keeping umberged decls, too, just not as often as LTO. I am not sure about operand_equal_p

Re: [libiberty][PATCH] Avoid zero-length VLAs.

2016-07-11 Thread Ian Lance Taylor
On Mon, Jul 11, 2016 at 1:05 PM, Brooks Moses wrote: > Ping? This is fine, but please add a comment explaining why the code avoids 0-length VLAs. Thanks. Ian > (I suspect I should have added a libiberty maintainer to cc in the first > place.) > > On Mon, Jun 13, 2016 at 9:05 AM, Brooks Moses

Re: Implement -Wswitch-fallthrough: libstdc++

2016-07-11 Thread Jonathan Wakely
On 11 July 2016 at 20:57, Marek Polacek wrote: > > 2016-07-11 Marek Polacek > > PR c/7652 > * libsupc++/hash_bytes.cc: Use __builtin_fallthrough. > > diff --git gcc/libstdc++-v3/libsupc++/hash_bytes.cc > gcc/libstdc++-v3/libsupc++/hash_bytes.cc > index 2e5bbfa..818331f 100644 >

Re: Implement -Wswitch-fallthrough: java

2016-07-11 Thread Tom Tromey
> "Marek" == Marek Polacek writes: Marek> +++ gcc/gcc/java/jcf-dump.c Marek> @@ -926,6 +926,8 @@ print_constant (FILE *out, JCF *jcf, int index, int verbosity) Marek>if (verbosity > 0) Marek> fprintf (out, "Fieldref: %ld=", (long) JPOOL_USHORT2 (jcf, index)); Marek>

Re: [PATCH], PowerPC support to enable -mlra and/or -mfloat128

2016-07-11 Thread Michael Meissner
Sigh, I keep forgetting to attach the patch. 2016-07-11 Michael Meissner * doc/install.texi (Configuration): Document PowerPC specific configuration options --enable-lra and --enable-float128. * configure.ac: Add --enable-lra and --enable-float128 to turn on -ml

[committed] Fix #pragma omp target * device (...) expansion (PR middle-end/71758)

2016-07-11 Thread Jakub Jelinek
Hi! As the following testcases show, if device clause argument doesn't have int type (or some compatible one), then we ICE, because we don't emit valid GIMPLE. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk and 6.2. 2016-07-11 Jakub Jelinek PR

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Jakub Jelinek
On Mon, Jul 11, 2016 at 04:43:57PM -0400, David Malcolm wrote: > On Mon, 2016-07-11 at 22:34 +0200, Jakub Jelinek wrote: > > On Mon, Jul 11, 2016 at 10:23:30PM +0200, Marek Polacek wrote: > > > On Mon, Jul 11, 2016 at 01:18:02PM -0700, Andi Kleen wrote: > > > > > I explained why supporting the clas

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread David Malcolm
On Mon, 2016-07-11 at 22:34 +0200, Jakub Jelinek wrote: > On Mon, Jul 11, 2016 at 10:23:30PM +0200, Marek Polacek wrote: > > On Mon, Jul 11, 2016 at 01:18:02PM -0700, Andi Kleen wrote: > > > > I explained why supporting the classic lint style comment > > > > wouldn't fly. > > > > > > Not convincin

[v3 PATCH] Implement P0307R2, Making Optional Greater Equal Again.

2016-07-11 Thread Ville Voutilainen
Tested on Linux-X64. The test adjustments are so that the tests are kept valid, which required adding a bunch of now-required relops to the test types. The new transparent-but-non-synthesizing aspects of the relops are tested separately. The constraints are a valid implementation of the current Re

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread David Malcolm
On Mon, 2016-07-11 at 22:20 +0200, Marek Polacek wrote: > On Mon, Jul 11, 2016 at 10:11:52PM +0200, Jakub Jelinek wrote: > > On Mon, Jul 11, 2016 at 10:08:02PM +0200, Eric Botcazou wrote: > > > > After I'd completed the warning, I kicked off a bootstrap so as > > > > to add > > > > various gcc_fall

Re: Implement -Wswitch-fallthrough: rs6000

2016-07-11 Thread Bruce Korb
I'm curious about this. In the process of developing a code analysis tool, I found some GCC code that was, basically: switch (v) { case 0: if (e) { do_something(); } else { case 1: do_something_else(); } } Does this patch mean that the above got fixed? I mean, if you're going to f

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Jakub Jelinek
On Mon, Jul 11, 2016 at 10:23:30PM +0200, Marek Polacek wrote: > On Mon, Jul 11, 2016 at 01:18:02PM -0700, Andi Kleen wrote: > > > I explained why supporting the classic lint style comment wouldn't fly. > > > > Not convincing, it worked fine for 30+ years of lints. > > So how can the compiler han

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Eric Botcazou
> I think that if *we* refuse to use __builtin_fallthrough, then we can't > expect users to use it. No disagreement, but this doesn't change my mind on the thing... IMO there ought to be a simple & standard way of silencing the warning if it is enabled by default, otherwise this will very likel

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread NightStrike
On Mon, Jul 11, 2016 at 3:43 PM, Marek Polacek wrote: > But then the [[fallthrough]] attribute was > approved for C++17 [1], and that's what has got me to do all this. > ... > I added a new builtin, > __builtin_fallthrough, that prevents the warning from occurring. It can only > be used in a swi

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Marek Polacek
On Mon, Jul 11, 2016 at 01:18:02PM -0700, Andi Kleen wrote: > > I explained why supporting the classic lint style comment wouldn't fly. > > Not convincing, it worked fine for 30+ years of lints. So how can the compiler handle /* Never ever fall through here */ ? Marek

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Marek Polacek
On Mon, Jul 11, 2016 at 10:11:52PM +0200, Jakub Jelinek wrote: > On Mon, Jul 11, 2016 at 10:08:02PM +0200, Eric Botcazou wrote: > > > After I'd completed the warning, I kicked off a bootstrap so as to add > > > various gcc_fallthrough calls. There were a good amount of them, as > > > expected. I

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Andi Kleen
> I explained why supporting the classic lint style comment wouldn't fly. Not convincing, it worked fine for 30+ years of lints. -Andi -- a...@linux.intel.com -- Speaking for myself only.

Re: [C++ PATCH] Fix ICE with PTRMEM_CST (PR c++/70869)

2016-07-11 Thread Jakub Jelinek
On Thu, Jul 07, 2016 at 03:06:55PM -0400, Jason Merrill wrote: > On Thu, Jul 7, 2016 at 2:23 PM, Jakub Jelinek wrote: > > On Thu, Jul 07, 2016 at 12:32:02PM -0400, Jason Merrill wrote: > >> Hmm, I wonder if walk_tree_1 should walk into DECL_EXPR like it does into > >> BIND_EXPR_VARS. But your pat

[C++ PATCH] Fix diagnostics ICE (PR c++/71835)

2016-07-11 Thread Jakub Jelinek
Hi! add_conv_candidate creates cand->fn which is not a FUNCTION_DECL, but some type, all spots in convert_like_real assume that if fn is non-NULL, it is some decl. Just a couple of lines above this hunk we even have a comment reminding us on cand->fn not having to be a decl: /* Since cand->

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Jakub Jelinek
On Mon, Jul 11, 2016 at 10:08:02PM +0200, Eric Botcazou wrote: > > After I'd completed the warning, I kicked off a bootstrap so as to add > > various gcc_fallthrough calls. There were a good amount of them, as > > expected. I also grepped various FALLTHRU/Falls through/...fall > > thru.../... com

[C++ PATCH] Fix lval {REAL,IMAG}PART_EXPR constexpr evaluation (PR c++/71828)

2016-07-11 Thread Jakub Jelinek
Hi! REALPART_EXPR and IMAGPART_EXPR are handled like unary expressions, even though they are references. For !lval that makes no difference, but for lval it means we can get ADDR_EXPR of INTEGER_CST etc., or trying to store into an INTEGER_CST. Fixed by doing roughly what we do for other referen

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Eric Botcazou
> After I'd completed the warning, I kicked off a bootstrap so as to add > various gcc_fallthrough calls. There were a good amount of them, as > expected. I also grepped various FALLTHRU/Falls through/...fall > thru.../... comments in config/ and added gcc_fallthroughs to make it > easier for peo

Re: [PATCH] Fix SLP vectorization ICE (PR tree-optimization/71823)

2016-07-11 Thread Richard Biener
On July 11, 2016 9:28:43 PM GMT+02:00, Jakub Jelinek wrote: >Hi! > >vect_get_vec_defs handles only one or two arguments, for ternary >ops like fma vectorizable_operation calls vect_get_vec_defs on the >first two arguments, and then did > vec_oprnds2.create (1); > vec_oprnds2.q

[PATCH], PowerPC support to enable -mlra and/or -mfloat128

2016-07-11 Thread Michael Meissner
These configuration switches will allow the PowerPC GCC developers to switch defaults in the compiler to debug the code, before making the decision to flip the default permanently. In the future, when the defaults have been changed, these configuration options would allow developers to go back to

Re: [libiberty][PATCH] Avoid zero-length VLAs.

2016-07-11 Thread Brooks Moses
Ping? (I suspect I should have added a libiberty maintainer to cc in the first place.) On Mon, Jun 13, 2016 at 9:05 AM, Brooks Moses wrote: > Zero-length variable-length-arrays are not allowed in standard C99, > and perhaps more importantly, they cause ASAN to complain. (See, > e.g., https://gc

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Marek Polacek
On Mon, Jul 11, 2016 at 01:01:05PM -0700, Andi Kleen wrote: > Marek Polacek writes: > > > > This warning is enabled by default for C/C++. > > That's purely evil. So have to put your non standard builtin all over > standards compliant code just to shut off a warning that is likely > common. And yo

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Andrew Pinski
On Mon, Jul 11, 2016 at 1:01 PM, Marek Polacek wrote: > On Mon, Jul 11, 2016 at 12:59:51PM -0700, Andrew Pinski wrote: >> I don't like it being default turned on or even part of -Wall. As >> evidence all of the patches that comes after this is the main reason >> why. > > Ok, moving this to -Wextr

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Marek Polacek
On Mon, Jul 11, 2016 at 12:59:51PM -0700, Andrew Pinski wrote: > I don't like it being default turned on or even part of -Wall. As > evidence all of the patches that comes after this is the main reason > why. Ok, moving this to -Wextra is rather trivial. Marek

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Andi Kleen
Marek Polacek writes: > > This warning is enabled by default for C/C++. That's purely evil. So have to put your non standard builtin all over standards compliant code just to shut off a warning that is likely common. And you're not even supporting the classic lint style comment either. I think i

Re: Implement -Wswitch-fallthrough: testsuite

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * c-c++-common/Wswitch-unreachable-1.c: Add __builtin_fallthrough. * c-c++-common/pr44832.c: Likewise. * g++.dg/lto/20090128_0.C: Likewise. * g++.dg/opt/pr14029.C: Likewise. * g++.dg/opt/pr45412.C: Likewise.

Re: Implement -Wswitch-fallthrough

2016-07-11 Thread Andrew Pinski
On Mon, Jul 11, 2016 at 12:43 PM, Marek Polacek wrote: > The switch fallthrough has been widely considered a design defect in C, a > misfeature or, to use Marshall Cline's definition, evil. The overwhelming > majority of the time you don't want to fall through to the next case, but it > is > eas

Re: Implement -Wswitch-fallthrough: rs6000

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * config/rs6000/rs6000.c (rs6000_builtin_vectorized_libmass): Likewise. (rs6000_legitimate_offset_address_p): Likewise. (rs6000_emit_move): Likewise. (altivec_expand_ld_builtin): Likewise. (altivec_expand_st_buil

Re: Implement -Wswitch-fallthrough: other archs

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * config/alpha/alpha.c (alpha_rtx_costs): Likewise. (alpha_legitimate_constant_p): Likewise. (alpha_emit_setcc): Likewise. (alpha_emit_xfloating_libcall): Likewise. (alpha_function_value_1): Likewise. (al

Re: Implement -Wswitch-fallthrough: objc

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * objc-encoding.c (encode_type): Add gcc_fallthrough. diff --git gcc/gcc/objc/objc-encoding.c gcc/gcc/objc/objc-encoding.c index 41ac6a4..cc64e1b 100644 --- gcc/gcc/objc/objc-encoding.c +++ gcc/gcc/objc/objc-encoding.c @@ -622,6 +622,7 @@ enco

Re: Implement -Wswitch-fallthrough: lto

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * lto-plugin.c (lto_fallthrough): Define. (parse_table_entry): Use it. diff --git gcc/lto-plugin/lto-plugin.c gcc/lto-plugin/lto-plugin.c index 51afc52..ffdf54a 100644 --- gcc/lto-plugin/lto-plugin.c +++ gcc/lto-plugin/lto-plugin.c @@

Re: Implement -Wswitch-fallthrough: libstdc++

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * libsupc++/hash_bytes.cc: Use __builtin_fallthrough. diff --git gcc/libstdc++-v3/libsupc++/hash_bytes.cc gcc/libstdc++-v3/libsupc++/hash_bytes.cc index 2e5bbfa..818331f 100644 --- gcc/libstdc++-v3/libsupc++/hash_bytes.cc +++ gcc/libstdc++-v

Re: Implement -Wswitch-fallthrough: libgo

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * runtime/heapdump.c (dumpefacetypes): Add break. diff --git gcc/libgo/runtime/heapdump.c gcc/libgo/runtime/heapdump.c index d0cfb01..1ce8aa2 100644 --- gcc/libgo/runtime/heapdump.c +++ gcc/libgo/runtime/heapdump.c @@ -766,6 +766,7 @@ dumpefa

Re: Implement -Wswitch-fallthrough: libiberty

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * cp-demangle.c (d_print_comp_inner): Use D_FALLTHRU. (d_print_mod): Likewise. * cplus-dem.c (demangle_signature): Likewise. (demangle_fund_type): Likewise. (do_hpacc_template_const_value): Likewise. * d-

Re: Implement -Wswitch-fallthrough: libgomp

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * libgomp.h (gomp_fallthrough): Define. * oacc-init.c (resolve_device): Use gomp_fallthrough. * testsuite/libgomp.c++/cancel-parallel-2.C: Add __builtin_fallthrough. * testsuite/libgomp.c/cancel-parallel-2.c: Add __built

Re: Implement -Wswitch-fallthrough: libgcc

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * soft-fp/soft-fp.h (_FP_FALLTHRU): Define. * soft-fp/op-common.h: Use it. diff --git gcc/libgcc/soft-fp/op-common.h gcc/libgcc/soft-fp/op-common.h index 080ef0e..6691f50 100644 --- gcc/libgcc/soft-fp/op-common.h +++ gcc/libgcc/soft-fp

Re: Implement -Wswitch-fallthrough: libcpp

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * internal.h (CPP_FALLTHRU): Define. * expr.c (_cpp_parse_expr): Use CPP_FALLTHRU. * lex.c (search_line_fast): Likewise. (lex_raw_string): Likewise. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Lik

Re: Implement -Wswitch-fallthrough: libatomic

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * libatomic_i.h (libat_fallthrough): New macro. * gcas.c (libat_compare_exchange): Use libat_fallthrough. * gexch.c (libat_exchange): Likewise. * glfree.c (libat_is_lock_free): Likewise. * gload.c (libat_load): L

Re: Implement -Wswitch-fallthrough: java

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * expr.c (java_truthvalue_conversion): Add gcc_fallthrough. (type_assertion_hasher::hash): Likewise. * jcf-dump.c (print_constant): Likewise. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type)

Re: Implement -Wswitch-fallthrough: i386

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * config/i386/driver-i386.c (decode_caches_intel): Likewise. (detect_caches_cpuid4): Likewise. * config/i386/i386-c.c (ix86_target_macros_internal): Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise.

Re: Implement -Wswitch-fallthrough: go

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * go-system.h (go_fallthrough): New macro. * gofrontend/escape.cc (Escape_analysis_assign::statement): Use it. (Escape_analysis_assign::assign): Likewise. * gofrontend/expressions.cc (Binary_expression::do_get_b

Re: Implement -Wswitch-fallthrough: aarch64 + arm

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add gcc_fallthrough. * config/aarch64/aarch64-simd.md: Likewise. * config/aarch64/aarch64.c (aarch64_expand_mov_immediate): Likewise. (aarch64_print_operan

Re: Implement -Wswitch-fallthrough: gcc/

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * Makefile.in (insn-attrtab.o-warn, insn-dfatab.o-warn, insn-latencytab.o-warn, insn-output.o-warn, insn-emit.o-warn): Add -Wno-switch-fallthrough. * alias.c (find_base_value): Add gcc_fallthrough. (find_base_ter

Re: Implement -Wswitch-fallthrough: cp/

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * call.c (add_builtin_candidate): Add gcc_fallthrough. (add_builtin_candidates): Likewise. (build_integral_nontype_arg_conv): Likewise. (build_new_op_1): Likewise. (convert_like_real): Likewise. * cfns.h

Re: Implement -Wswitch-fallthrough: fortran/

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * arith.c (eval_intrinsic): Add gcc_fallthrough. * array.c (gfc_ref_dimen_size): Likewise. (gfc_array_dimen_size): Likewise. * cpp.c (gfc_cpp_handle_option): Likewise. (cb_cpp_error): Likewise. * decl.c (

Re: Implement -Wswitch-fallthrough: c-family/

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * c-ada-spec.c (print_ada_macros): Add gcc_fallthrough. (to_ada_name): Likewise. (dump_generic_ada_node): Likewise. (dump_nested_type): Likewise. * c-common.c (warn_if_unused_value): Likewise. (sizeof_poi

Re: Implement -Wswitch-fallthrough: c/

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * c-array-notation.c (expand_array_notations): Add gcc_fallthrough. * c-decl.c (pop_scope): Likewise. (grokdeclarator): Likewise. (get_parm_info): Likewise. * c-objc-common.c (c_tree_printer): Likewise. *

Re: Implement -Wswitch-fallthrough: core

2016-07-11 Thread Marek Polacek
2016-07-11 Marek Polacek PR c/7652 * builtins.c (expand_builtin): Handle BUILT_IN_FALLTHROUGH. * builtins.def: Add BUILT_IN_FALLTHROUGH. * common.opt (Wswitch-fallthrough): New option. * doc/extend.texi: Document __builtin_fallthrough. * doc/invok

[PATCH, i386]: Hoist common code in x86_64{,_zext}_immediate_operand predicates

2016-07-11 Thread Uros Bizjak
No functional changes. 2016-07-11 Uros Bizjak * config/i386/predicates.md (x86_64_immediate_operand) : Hoist common subexpressions. (x86_64_zext_immediate_operand) : Ditto. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. diff --gi

Implement -Wswitch-fallthrough

2016-07-11 Thread Marek Polacek
The switch fallthrough has been widely considered a design defect in C, a misfeature or, to use Marshall Cline's definition, evil. The overwhelming majority of the time you don't want to fall through to the next case, but it is easy to forget to "break" at the end of the case, making this far too

[PATCH, rs6000, libgcc] Implement temporary solution for __divkc3 and __mulkc3

2016-07-11 Thread Bill Schmidt
Hi, It was recently brought to my attention that glibc needs access to complex multiply and divide for IEEE-128 floating-point in GCC 6.2 in order to move ahead with the library implementation work. This patch enables this support using only target-specific changes to avoid any possible effect on

[C++ PATCH] Fix error recovery in tsubst_baselink (PR c++/71826)

2016-07-11 Thread Jakub Jelinek
Hi! Most of the spots in tsubst_baselink that actually access baselink after it has been assigned lookup_fnfields () test that it is a BASELINK_P, except one - the BASELINK_OPTYPE update. lookup_fnfields can return error_mark_node though, perhaps something else too. The patch just follows what t

[PATCH] Fix SLP vectorization ICE (PR tree-optimization/71823)

2016-07-11 Thread Jakub Jelinek
Hi! vect_get_vec_defs handles only one or two arguments, for ternary ops like fma vectorizable_operation calls vect_get_vec_defs on the first two arguments, and then did vec_oprnds2.create (1); vec_oprnds2.quick_push (vect_get_vec_def_for_operand (op2,

[C++ PATCH] Fix ICE with SIZEOF_EXPR in default arg (PR c++/71822)

2016-07-11 Thread Jakub Jelinek
Hi! For SIZEOF_EXPR, we rely on cp_fold to fold it. But, for VEC_INIT_EXPR initialization, we actually just genericize it without ever folding the expressions, so e.g. if the ctor has default args and some complicated expressions in there, they will never be cp_folded. This is the only place that

Re: [patch] Fix type merging deficiency during WPA

2016-07-11 Thread Eric Botcazou
> It is fine to merge decls across static and external flags, but I am not > sure this is a safe solution to the problem. In C it is perfectly normal to > have one decl more specified or with different attributes. Like: > > extern int a __attribute__ ((warning("bar")); > > int a=7 __attribute__

[arm-embedded] [PATCH, ARM 3/7, ping1] Fix indentation of FL_FOR_ARCH* definition after adding support for ARMv8-M

2016-07-11 Thread Thomas Preudhomme
We've decided to apply the following patch to ARM/embedded-6-branch. Best regards, Thomas -- Forwarded Message -- Subject: Re: [PATCH, ARM 3/7, ping1] Fix indentation of FL_FOR_ARCH* definition after adding support for ARMv8-M Date: Wednesday 18 May 2016, 14:47:16 From: Kyril

[arm-embedded] [PATCH, ARM 4/7, ping1] Factor out MOVW/MOVT availability and desirability checks

2016-07-11 Thread Thomas Preudhomme
We've decided to apply the following patch to ARM/embedded-6-branch. Best regards, Thomas -- Forwarded Message -- Subject: Re: [PATCH, ARM 4/7, ping1] Factor out MOVW/MOVT availability and desirability checks Date: Thursday 07 July 2016, 09:59:53 From: Thomas Preudhomme To:

[arm-embedded] [PATCH, ARM 2/7, ping1] Add support for ARMv8-M

2016-07-11 Thread Thomas Preudhomme
We've decided to apply the following patch to ARM/embedded-6-branch. Best regards, Thomas -- Forwarded Message -- Subject: Re: [PATCH, ARM 2/7, ping1] Add support for ARMv8-M Date: Thursday 07 July 2016, 09:57:08 From: Thomas Preudhomme To: Kyrill Tkachov CC: Richard Earnsha

[arm-embedded] [PATCH, libgcc/ARM 1/6] Fix Thumb-1 only == ARMv6-M & Thumb-2 only == ARMv7-M assumptions

2016-07-11 Thread Thomas Preudhomme
We've decided to apply the following patch to ARM/embedded-6-branch. Best regards, Thomas -- Forwarded Message -- Subject: Re: [PATCH, libgcc/ARM 1/6] Fix Thumb-1 only == ARMv6-M & Thumb-2 only == ARMv7-M assumptions Date: Wednesday 06 July 2016, 17:20:04 From: Ramana Radhakr

[arm-embedded] [PATCH, libgcc/ARM 1a/6] Fix Thumb-1 only == ARMv6-M & Thumb-2 only == ARMv7-M assumptions

2016-07-11 Thread Thomas Preudhomme
We've decided to apply the following patch to ARM/embedded-6-branch. Best regards, Thomas -- Forwarded Message -- Subject: Re: [PATCH, libgcc/ARM 1a/6] Fix Thumb-1 only == ARMv6-M & Thumb-2 only == ARMv7-M assumptions Date: Wednesday 06 July 2016, 17:21:24 From: Ramana Radha

Re: RFA: new pass to warn on questionable uses of alloca() and VLAs

2016-07-11 Thread Martin Sebor
On 07/11/2016 09:40 AM, Aldy Hernandez wrote: On 07/11/2016 11:08 AM, Martin Sebor wrote: Hey, I'm all for different options. It would definitely be easier for me :). I wast trying really hard to use -Wvla= and keep the current -Wvla meaning the same. Though I see your point about using -Wvl

Re: [PATCH][expr.c] PR middle-end/71700: zero-extend sub-word value when widening constructor element

2016-07-11 Thread Bernd Schmidt
On 07/11/2016 04:52 PM, Kyrill Tkachov wrote: Based on that, I think that code block is a useful optimisation, we just need to take care with immediates. What do you think? Yeah, I think the patch is ok. Bernd

Re: [PATCHv2, ARM, libgcc] New aeabi_idiv function for armv6-m

2016-07-11 Thread Andre Vieira (lists)
On 06/07/16 11:52, Andre Vieira (lists) wrote: > On 01/07/16 14:40, Ramana Radhakrishnan wrote: >> >> >> On 13/10/15 18:01, Andre Vieira wrote: >>> This patch ports the aeabi_idiv routine from Linaro Cortex-Strings >>> (https://git.linaro.org/toolchain/cortex-strings.git), which was >>> contribut

[PATCHv2][ARM] -mpure-code option for ARM

2016-07-11 Thread Andre Vieira (lists)
On 07/07/16 13:30, mickael guene wrote: > Hi Andre, > > Another feedback on your purecode patch. > You have to disable casesi pattern since then it will > generate wrong code with -mpure-code option. > Indeed it will generate an 'adr rx, .Lx' (aka > 'subs rx, PC, #offset') which will not work i

Small C++ PATCH to remove dead code

2016-07-11 Thread Jason Merrill
This code in store_parm_decls never fired, because we were checking VOID_TYPE_P on the PARM_DECL itself rather than its type. And we already check for void parms in grokparms, so there's no point in doing it here. Tested x86_64-pc-linux-gnu, applying to trunk. commit 7bc6f4c24e2e853ff18bd61f116e0

Re: RFA: new pass to warn on questionable uses of alloca() and VLAs

2016-07-11 Thread Aldy Hernandez
On 07/11/2016 11:08 AM, Martin Sebor wrote: Hey, I'm all for different options. It would definitely be easier for me :). I wast trying really hard to use -Wvla= and keep the current -Wvla meaning the same. Though I see your point about using -Wvla* but using different variables for representi

Fix loop_only_exit_p

2016-07-11 Thread Jan Hubicka
Hi, while looking into loop code I noticed that loop_only_exit_p seems overly simplistic. The purpose of this predicate is to decide whether the loop must terminate by the exit given (so for example it is known that the number of iteration test in that particular exit won't overflow because undefin

Re: [PATCH] Fix Fortran DO loop fallback

2016-07-11 Thread Mike Stump
> On Jul 11, 2016, at 7:44 AM, Jeff Law wrote: > > On 07/08/2016 08:26 AM, Martin Liška wrote: >> Hello >> >> Following patch fixes fallout caused by the patch set: >> https://gcc.gnu.org/ml/gcc-regression/2016-07/msg00097.html >> >> Ready after it finished regression tests? >> Thanks, >> Mart

Re: RFA: new pass to warn on questionable uses of alloca() and VLAs

2016-07-11 Thread Martin Sebor
Hey, I'm all for different options. It would definitely be easier for me :). I wast trying really hard to use -Wvla= and keep the current -Wvla meaning the same. Though I see your point about using -Wvla* but using different variables for representing -Wvla and -Wvla=blah. The easiest thing w

Re: [patch] Fix type merging deficiency during WPA

2016-07-11 Thread Jan Hubicka
Hi, Sorry for jumping in late, only now I had chance to read through the whole discussion. I was looking into similar problem some time ago. > Index: lto-streamer-out.c > === > --- lto-streamer-out.c(revision 238156) > +++ lt

Re: [PATCH] PR target/71801: Don't convert TImode in debug insn

2016-07-11 Thread Uros Bizjak
On Mon, Jul 11, 2016 at 3:48 PM, H.J. Lu wrote: > When converting V1TImode register in debug insn, check if it has been > converted to TImode already. > > Tested on x86-64. OK for trunk? I was looking to use simplify_subreg here, but it is too complicated for the known purpose. > H.J. > --- > g

Re: [patch] Fix DWARF type output for non-default address spaces

2016-07-11 Thread Jeff Law
On 07/07/2016 09:06 PM, James Bowman wrote: FT32 makes use of multiple address spaces. When trying to inspect objects in GDB, GDB was treating them as a straight "const". The cause seems to be in GCC DWARF2 output. This output is handled in gcc/gcc/dwarf2out.c, where modified_type_die() checks t

Re: [PATCH][expr.c] PR middle-end/71700: zero-extend sub-word value when widening constructor element

2016-07-11 Thread Kyrill Tkachov
On 05/07/16 13:57, Kyrill Tkachov wrote: Hi Bernd, On 04/07/16 19:02, Bernd Schmidt wrote: On 07/01/2016 11:18 AM, Kyrill Tkachov wrote: In this arm wrong-code PR the struct assignment goes wrong when expanding constructor elements to a register destination when the constructor elements are s

Re: [RFC, v2] Test coverage for --param boundary values

2016-07-11 Thread Jeff Law
On 07/08/2016 06:47 AM, Martin Liška wrote: Hi. This is my second attempt of the patch where I generate all tests on fly. Firstly, params-options.h is used to generate a list of options in form of: "predictable-branch-outcome"=2,0,50 "inline-min-speedup"=10,0,0 "max-inline-insns-single"=400,0,0

Re: [PATCH] Fix Fortran DO loop fallback

2016-07-11 Thread Jeff Law
On 07/08/2016 08:26 AM, Martin Liška wrote: Hello Following patch fixes fallout caused by the patch set: https://gcc.gnu.org/ml/gcc-regression/2016-07/msg00097.html Ready after it finished regression tests? Thanks, Martin 0001-Fix-Fortran-DO-loop-fallback.patch From c5dd7ad62f795cce560c7f1b

Re: [PING] Re: [PATCH] input.c: add lexing selftests and a test matrix for line_table states

2016-07-11 Thread Jeff Law
On 07/08/2016 09:00 AM, David Malcolm wrote: Ping. I believe I need review of the selftest.h change; the rest I think I can self-approve, if need be. https://gcc.gnu.org/ml/gcc-patches/2016-06/msg01340.html OK. jeff

Re: [PATCH] Introduce new param: AVG_LOOP_NITER

2016-07-11 Thread Jeff Law
On 07/11/2016 01:55 AM, Martin Liška wrote: Hello. During investigation of an IVOPTs issue, I noticed that tree-ssa-loop-ivopts.c uses a hard-coded constant AVG_LOOP_NITER. Very similar constant can be seen in cfgloopanal.c. Thus, I've changed that to a new param. Apart from that, I would lik

Re: [RFC] Convert TYPE_ALIGN_OK into an TYPE_LANG_FLAG

2016-07-11 Thread Jeff Law
On 07/10/2016 09:32 AM, Bernd Edlinger wrote: On 07/10/16 10:23, Eric Botcazou wrote: I expect it still has an effect due to the same reason as the DECL_OFFSET_ALIGN thing - memory reference expansion doesn't gather information from the full reference but tries to re-cover it from the pieces ret

Re: RFA: new pass to warn on questionable uses of alloca() and VLAs

2016-07-11 Thread Jeff Law
On 07/10/2016 04:09 PM, Martin Sebor wrote: On 07/08/2016 05:48 AM, Aldy Hernandez wrote: I've played with the patch a bit over the weekend and have a few comments and suggestions (I hope you won't regret encouraging me :) I like the consistency between -Walloca and -Wvla! (And despite the volum

Re: RFA: new pass to warn on questionable uses of alloca() and VLAs

2016-07-11 Thread Jeff Law
On 07/08/2016 05:48 AM, Aldy Hernandez wrote: [New thread now that I actually have a tested patch :)]. I think detecting potentially problematic uses of alloca would be useful, especially when done in an intelligent way like in your patch (as opposed to simply diagnosing every call to the funct

Re: RFA: new pass to warn on questionable uses of alloca() and VLAs

2016-07-11 Thread Manuel López-Ibáñez
On 11 July 2016 at 11:10, Aldy Hernandez wrote: > On 07/10/2016 07:41 PM, Manuel López-Ibáñez wrote: >>> >>> +Walloca >>> +LangEnabledBy(C ObjC C++ ObjC++) >>> +; in common.opt >>> + >>> +Walloca= >>> +LangEnabledBy(C ObjC C++ ObjC++) >>> +; in common.opt >>> + >> >> >> I'm not sure what you think

Re: [PATCH] Support running the selftests under valgrind

2016-07-11 Thread Jeff Law
On 07/08/2016 01:46 PM, David Malcolm wrote: This patch adds a new phony target to gcc/Makefile.in to make it easy to run the selftests under valgrind, via "make selftest-valgrind". This phony target isn't a dependency of anything; it's purely for convenience (it takes about 4-5 seconds on my box

[PATCH] PR target/71801: Don't convert TImode in debug insn

2016-07-11 Thread H.J. Lu
When converting V1TImode register in debug insn, check if it has been converted to TImode already. Tested on x86-64. OK for trunk? H.J. --- gcc/ PR target/71801 * config/i386/i386.c (timode_scalar_chain::fix_debug_reg_uses): Don't convert TImode in debug insn. gcc/tests

Re: [PATCH, vec-tails 07/10] Support loop epilogue combining

2016-07-11 Thread Ilya Enkovich
Ping 2016-06-28 15:24 GMT+03:00 Ilya Enkovich : > On 16 Jun 10:54, Jeff Law wrote: >> On 05/19/2016 01:44 PM, Ilya Enkovich wrote: >> >Hi, >> > >> >This patch introduces support for loop epilogue combining. This includes >> >support in cost estimation and all required changes required to mask >>

Re: [PATCH, vec-tails 05/10] Check if loop can be masked

2016-07-11 Thread Ilya Enkovich
Ping 2016-06-23 12:54 GMT+03:00 Ilya Enkovich : > On 22 Jun 11:42, Jeff Law wrote: >> On 06/22/2016 10:09 AM, Ilya Enkovich wrote: >> >> >>Given the common structure & duplication I can't help but wonder if a >> >>single >> >>function should be used for widening/narrowing. Ultimately can't you s

Re: [PATCH, vec-tails 03/10] Support epilogues vectorization with no masking

2016-07-11 Thread Ilya Enkovich
Ping 2016-06-24 10:40 GMT+03:00 Ilya Enkovich : > On 17 Jun 10:46, Jeff Law wrote: >> On 06/17/2016 08:33 AM, Ilya Enkovich wrote: >> >> >> >>Hmm, there seems to be a level of indirection I'm missing here. We're >> >>smuggling LOOP_VINFO_ORIG_LOOP_INFO around in loop->aux. Ewww. I thought >> >>

Re: [PATCH, vec-tails 08/10] Support loop epilogue masking and low trip count loop vectorization

2016-07-11 Thread Ilya Enkovich
Ping 2016-06-24 14:46 GMT+03:00 Ilya Enkovich : > On 16 Jun 18:52, Ilya Enkovich wrote: >> 2016-06-15 15:00 GMT+03:00 Richard Biener : >> > On Thu, May 19, 2016 at 9:46 PM, Ilya Enkovich >> > wrote: >> >> Hi, >> >> >> >> This patch enables vectorization of loop epilogues and low trip count >> >>

Re: [PATCH, vec-tails 04/10] Add masking cost

2016-07-11 Thread Ilya Enkovich
Ping 2016-06-22 17:13 GMT+03:00 Ilya Enkovich : > On 16 Jun 00:16, Jeff Law wrote: >> On 05/19/2016 01:40 PM, Ilya Enkovich wrote: >> >Hi, >> > >> >This patch extends vectorizer cost model to include masking cost by >> >adding new cost model locations and new target hook to compute >> >masking cos

Re: [PATCH, vec-tails 01/10] New compiler options

2016-07-11 Thread Ilya Enkovich
Ping 2016-06-16 16:42 GMT+03:00 Ilya Enkovich : > On 20 May 14:40, Ilya Enkovich wrote: >> > Can you make all these --params then? I think to be useful to users we'd >> > want >> > them to be loop pragmas rather than options. >> >> OK, I'll change it to params. I didn't think about control via

[PATCH] Fix PR71816

2016-07-11 Thread Richard Biener
The following patch fixes PR71816. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2016-07-11 Richard Biener PR tree-optimization/71816 * tree-ssa-pre.c (compute_avail): Adjust alignment of ref rather than replacing all of its operands.

Re: [patch] Fix type merging deficiency during WPA

2016-07-11 Thread Eric Botcazou
> So sth like > > Index: gcc/lto-streamer-out.c > === > --- gcc/lto-streamer-out.c (revision 238039) > +++ gcc/lto-streamer-out.c (working copy) > @@ -996,7 +996,7 @@ hash_tree (struct streamer_tree_cache_d >else >

Re: [PATCH, rs6000] Fix PR target/71733, ICE with -mcpu=power9 -mno-vsx

2016-07-11 Thread Ulrich Weigand
Alan Modra wrote: > The reason this fails is that no alternative in altivec_mov > exactly matches. Ideally reload would choose the Z,v alternative > (cost 9) and you'd get an address reload for the mem to make it match > the "Z" constraint. Instead reload chooses the Y,r alternative (cost > 8) as

  1   2   >