https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101765

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Kacper Słomiński from comment #2)
> (In reply to Iain Sandoe from comment #1)
> > I am not sure that a VLA can be used in a coroutine (neither can alloca, if
> > I remember correctly) [so not sure that this is ICE on valid, it could be
> > ICE on invalid]
> > 
> > Either way, we should not ICE from it.
> 
> Using alloca or __builtin_alloca inside of coroutines compiles fine,

That's probably an error ;-) ... I recall discussing this with Gor after Jakub
raised the question at a GNU cauldron - with the outcome that the original
implementation (MSVC) errors-out on alloca.  

> but
> despite that I think this should be ICE-on-invalid,

yeah, a VLA would mean a (potentially) different frame layout for each call -
which the current implementations do not support.

> as I don't see how stack
> allocations would work inside of coroutines, since AFAIK the coro frame size
> must be known up-front.

It must be a compile-time constant, known before lowering to IR - but we should
not ICE  in any case.

( I have not had a chance yet to process this further )

Reply via email to