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

--- Comment #23 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> The C/C++ FEs since r9-6625-gbec1da64aec26a490 turn some array initializers
> into strings.

Ouch.  I'm not sure that's worthwhile if the arrays are not byte-aligned.

> Anyway, I wonder if for GCC 14 we couldn't just treat STRING_CST the same as
> INTEGER_CST during the merging into groups and instead deal with all of that
> during split_group.
> I.e. only at that time see that for this subset of stores we want to merge
> them into one STRING_CST store, these others handle differently, etc.  And
> the preconditions for handling something the STRING_CST way would be
> contiguous chunk with byte aligned start/end containg at least one longer
> STRING_CST.  So, we wouldn't give up e.g. in
> the second testcase, but merge the STRING_CSTs stores with the 4 byte
> INTEGER_CST store in between them, while handling the bitfield stuff at the
> start and/or the end to separate stores.

The handling was separate because STRING_CSTs (+ 1-byte INTEGER_CSTs) were
supposed to be relatively separate from other INTEGER_CSTs, but GCC 9+'s
behavior clearly makes this a bit obsolete.  The implementation is ad-hoc at
best so any idea to streamline it is warmly welcome; for Ada, we are only
interested in bona fide character strings that we want to concatenate as if
they were statically concatenated in the source code.

Reply via email to