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

--- Comment #3 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Richard Biener from comment #2)
> So that means DECL_SIZE is not properly updated by the FE?

that is generally not done, and I can't tell if it is right
or wrong, since sizeof(s) should not include the flexible array.

Normally varasm.c works around this because it sees the
additional CONSTRUCTOR elements and assembles them.

But in this case the FE strips the non-constant initializers
from the decl and generates code to initialize them.
Everything would work if at least the final element of the
flexible array is assembled as zero.

That can be seen in the example, when the flexible arrays
are initilialized with a constant as last element, the code works:

static Ax s = { 3, { i, j, k, 0 } };

Reply via email to