Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-19 Thread Jakub Jelinek
On Wed, Mar 16, 2016 at 04:11:56PM +0100, Marek Polacek wrote: > > 2016-03-09 Marek Polacek > > > > PR c/70093 > > * c-typeck.c (build_function_call_vec): Create a TARGET_EXPR for > > nested functions returning VM types. > > > > * cgraphunit.c

Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-19 Thread Marek Polacek
Ping. On Wed, Mar 09, 2016 at 04:55:23PM +0100, Marek Polacek wrote: > On Wed, Mar 09, 2016 at 04:31:37PM +0100, Jakub Jelinek wrote: > > No, I meant: > > switch (n) > > { > > struct S x; > > case 1: > > fn (); > > break; > > case 2: > > fn2 (); > >

Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-09 Thread Marek Polacek
On Wed, Mar 09, 2016 at 04:31:37PM +0100, Jakub Jelinek wrote: > No, I meant: > switch (n) > { > struct S x; > case 1: > fn (); > break; > case 2: > fn2 (); > break; > case 3: > x = fn (); > if (x.a[0] != 42) > __builtin_abort (); >

Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-09 Thread Jakub Jelinek
On Wed, Mar 09, 2016 at 04:20:24PM +0100, Marek Polacek wrote: > --- gcc/testsuite/gcc.dg/nested-func-10.c > +++ gcc/testsuite/gcc.dg/nested-func-10.c > @@ -0,0 +1,49 @@ > +/* PR c/70093 */ > +/* { dg-do compile } */ > +/* { dg-options "" } */ > + > +void > +foo (int n) > +{ > + struct S { int

Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-09 Thread Marek Polacek
On Wed, Mar 09, 2016 at 03:45:45PM +0100, Jakub Jelinek wrote: > Instead of the expecting warnings, wouldn't it be better to simply call > __builtin_abort () in fn ()? Maybe. Done. > > + struct S x; > > + x = fn (); > > + > > + if (x.a[0] != 42) > > +__builtin_abort (); > > + > > + if

Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-09 Thread Jakub Jelinek
On Wed, Mar 09, 2016 at 03:34:40PM +0100, Marek Polacek wrote: > --- gcc/testsuite/gcc.dg/nested-func-10.c > +++ gcc/testsuite/gcc.dg/nested-func-10.c > @@ -0,0 +1,45 @@ > +/* PR c/70093 */ > +/* { dg-do compile } */ > +/* { dg-options "" } */ > + > +void > +foo (int n) > +{ > + struct S { int

Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-09 Thread Marek Polacek
On Wed, Mar 09, 2016 at 12:24:42PM +0100, Jakub Jelinek wrote: > On Wed, Mar 09, 2016 at 12:05:51PM +0100, Marek Polacek wrote: > > This PR points out that nested functions returning VM types don't work as > > expected (yeah, go figure). We got an ICE on the testcase because we were > > trying to

Re: C PATCH for c/70093 (ICE with nested-function returning VM type)

2016-03-09 Thread Jakub Jelinek
On Wed, Mar 09, 2016 at 12:05:51PM +0100, Marek Polacek wrote: > This PR points out that nested functions returning VM types don't work as > expected (yeah, go figure). We got an ICE on the testcase because we were > trying to allocate variable-sized temporary instead of using __builtin_alloca >