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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Nathan Sidwell from comment #8)
> The fix for both bugs is the same -- reject creation of arrays of trailing
> array elements.  We used to reject initializers for such arrays, then we
> silently accepted them (generating wrong code), now we ICE.  It seems
> perverse to think going from 'silent wrong code' to 'ICE' to be a regression.
> 
> I suspect we could easily generate wrong code even without an initializer,
> as the array layout would overlay a previous element's trailing array with a
> subsequent element.  That's bound to confuse optimizers.

I thought that such constructs are widely used though, I believe e.g. glibc
used arrays of structs with flexible array members in several places.  Maybe it
has changed, I've lost track.  So, before changing anything like that we'd need
to make sure e.g. glibc still builds.

Reply via email to