This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Undefined behavior in genautomata.c?
Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
>>> Do you suppose the idiom is common enough that VRP could special-case
>>> "arrays of size 1 at the end of a struct" ? And still obtain the
benefits
>>> of the optimisation in 99.99% of all non-variable-length-tail-array
cases?
>>
>> It makes sense to me. We could special case "arrays of size 1 at the end
of
>> the struct", and treat it as C99 flexible array members. Any other case
>> could simply be considered broken.
>
> broken with respect to what?
broken as in undefined behaviour? We would still be doing the right thing in
the common case that people use, and optimize all the others.
--
Giovanni Bajo