[Ada] Fix PR ada/71817

2016-07-11 Thread Eric Botcazou
Tested on PowerPC/VxWorks, applied on the mainline. 2016-07-11 Eric Botcazou PR ada/71817 * adaint.c (__gnat_is_read_accessible_file): Add parentheses. (__gnat_is_write_accessible_file): Likewise. -- Eric BotcazouIndex: adaint.c ==

[PATCH] Introduce new param: AVG_LOOP_NITER

2016-07-11 Thread Martin Liška
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 like to change the default value to 10. As number

[Ada] Small tweak in LTO mode

2016-07-11 Thread Eric Botcazou
This make sure the TREE_READONLY flag is set consistently on the definition and the references of public entities in LTO mode. Tested on x86_64-suse-linux, applied on the mainline. 2016-07-11 Eric Botcazou * gcc-interface/trans.c (add_decl_expr): Minor tweak. * gcc-interface

Re: [PATCH/AARCH64] Add rtx_costs routine for vulcan.

2016-07-11 Thread James Greenhalgh
On Fri, Jul 08, 2016 at 04:01:33PM +0530, Virendra Pathak wrote: > Hi James, > > Please find the patch after taking care of your comments. > > > > Did you see those patches, and did you consider whether there would be a > > benefit to doing the same for Vulcan? > In our simulation environment, w

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

2016-07-11 Thread Segher Boessenkool
On Mon, Jul 11, 2016 at 04:07:11PM +0930, Alan Modra wrote: > I believe all the r alternatives in altivec_mov should be > disparaged with "?". That certainly makes sense. Okay for trunk if tested (also test with LRA, if you can). Thanks! Segher

Re: [PATCH/AARCH64] Add rtx_costs routine for vulcan.

2016-07-11 Thread Virendra Pathak
Hi James, > This patch is OK. Thanks for the review. > Julian has commit rights and is on the ChangeLog, so I'll let him > commit the patch on your behalf. Julian, Kindly commit the patch to the trunk. Thanks. with regards, Virendra Pathak On Mon, Jul 11, 2016 at 2:28 PM, James Greenhalgh wr

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

2016-07-11 Thread Aldy Hernandez
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 the above means, but this is an invalid use of LangEnabledBy(). (It would be nice if the .a

[PATCH, PR ipa/71633] Fix inlining into thunks

2016-07-11 Thread Ilya Enkovich
Hi, Currently when we expand thunk in inliner we assume its body has a single call. This is wrong for cases when thunk is instrumented. It means we might try to continue inlining for wrong edge. This simple patch fixes it. Bootstrapped and regtested on x86_64-unknown-linux-gnu. OK for trunk?

Re: [PATCH] rs6000: Make the ctr* patterns allow ints in vector regs (PR71763)

2016-07-11 Thread Alan Modra
On Fri, Jul 08, 2016 at 04:17:36AM -0500, Segher Boessenkool wrote: > Maybe just UNSPEC_BDZ? UNSPEC_DOLOOP? Committed revision 238207, using UNSPEC_DOLOOP. -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] rs6000: Make the ctr* patterns allow ints in vector regs (PR71763)

2016-07-11 Thread David Edelsohn
Should we backport this? At least Alan's UNSPEC_DOLOOP part? - David On Mon, Jul 11, 2016 at 6:30 AM, Alan Modra wrote: > On Fri, Jul 08, 2016 at 04:17:36AM -0500, Segher Boessenkool wrote: >> Maybe just UNSPEC_BDZ? UNSPEC_DOLOOP? > > Committed revision 238207, using UNSPEC_DOLOOP. > > -- > A

New libstdc++ testsuite failures on AIX

2016-07-11 Thread David Edelsohn
Jason, I believe that one of the patches in your recent C++ series introduced some new libstdc++ testsuite failures on AIX. With r238197 the problem exists and with r238169 (after the libstdc++ changes but before your C++ patches) the failures are not present. Note that this was tested with Rich

Re: [PATCH] rs6000: Make the ctr* patterns allow ints in vector regs (PR71763)

2016-07-11 Thread Segher Boessenkool
On Mon, Jul 11, 2016 at 06:54:44AM -0400, David Edelsohn wrote: > Should we backport this? At least Alan's UNSPEC_DOLOOP part? The *wi is a bugfix; I'll backport it, just like the *d (already did that one, 6 and 5; do we want 4.9 as well?) Alan's last patch would be good to have as well, it is a

Re: [PATCH v5] Allocate constant size dynamic stack space in the prologue

2016-07-11 Thread Dominik Vogt
On Thu, Jul 07, 2016 at 12:57:16PM +0100, Dominik Vogt wrote: > On Wed, Jul 06, 2016 at 02:01:06PM +0200, Bernd Schmidt wrote: > > There's one thing I don't quite understand and which seems to have > > changed since v1: > > > > On 07/04/2016 02:19 PM, Dominik Vogt wrote: > > >@@ -1099,8 +1101,10 @

Patch ping

2016-07-11 Thread Jakub Jelinek
Hi! I'd like to ping PR71716 - fix hang with long double atomics http://gcc.gnu.org/ml/gcc-patches/2016-07/msg00045.html Thanks Jakub

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

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 >

[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, 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

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 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 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 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 >>

[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] 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

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: 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 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: [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: [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: [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] 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: [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][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: [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] 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 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: 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 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

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: 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

[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: [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

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: 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

[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

[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, 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, 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 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

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__

[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

[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 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, 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

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, 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

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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 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

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 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 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: [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

[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: [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

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

[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 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 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: [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

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: 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 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 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 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 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: 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

  1   2   >