Re: fix middle-end/71476

2016-06-10 Thread Jakub Jelinek
On Fri, Jun 10, 2016 at 06:04:47PM +0200, Marek Polacek wrote: > > Wouldn't it be better to just walk_gimple_seq with NULL callback_op > > and non-NULL callback_stmt that would stop on the first real stmt in there? > > Ok, such as in the following? > > > Also, the above loop looks confusing, I'd

Re: fix middle-end/71476

2016-06-10 Thread Marek Polacek
On Fri, Jun 10, 2016 at 02:52:08PM +0200, Jakub Jelinek wrote: > Won't this just give up on say: > void > foo (int a, int b) > { > switch (a) > { > { int c; } > { int d; } > { int e; } > b++; > case 1: > break; > } > } > > ? Such blocks can also be can

Re: fix middle-end/71476

2016-06-10 Thread Jakub Jelinek
On Fri, Jun 10, 2016 at 02:36:23PM +0200, Marek Polacek wrote: > --- gcc/gimplify.c > +++ gcc/gimplify.c > @@ -1559,6 +1559,50 @@ gimplify_statement_list (tree *expr_p, gimple_seq > *pre_p) >return GS_ALL_DONE; > } > > +/* Possibly warn about unreachable statements between switch's controll

Re: fix middle-end/71476

2016-06-10 Thread Marek Polacek
On Fri, Jun 10, 2016 at 02:36:23PM +0200, Marek Polacek wrote: > While working on something else I discovered this ICE-on-invalid. > The problem is that when looking into the innermost lexical scope, > gimple_bind_body might be null, so check 'seq' first before checking > its gimple_code. > I facto

fix middle-end/71476

2016-06-10 Thread Marek Polacek
While working on something else I discovered this ICE-on-invalid. The problem is that when looking into the innermost lexical scope, gimple_bind_body might be null, so check 'seq' first before checking its gimple_code. I factored the code to its own function so that I can simply 'return'. Bootstra