On Tue, 29 Oct 2024, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs, because > add_flexible_array_elts_to_size -> complete_array_type > is done only after braced_lists_to_strings which optimizes > RAW_DATA_CST surrounded by INTEGER_CST into a larger RAW_DATA_CST > covering even the boundaries, while I thought it is done before > that. > So, RAW_DATA_CST now can be the last constructor_elt in a CONSTRUCTOR > and so we need the function to take it into account (handle it as > RAW_DATA_CST standing for RAW_DATA_LENGTH consecutive elements). > > The function wants to support both CONSTRUCTORs without indexes and with > them (for non-RAW_DATA_CST elts it was just adding 1 for the current > index). So, if the RAW_DATA_CST elt has ce->index, we need to add > RAW_DATA_LENGTH (ce->value) - 1, while if it doesn't (and it isn't cnt == 0 > case where curindex is 0), add that plus 1, i.e. RAW_DATA_LENGTH (ce->value). > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
OK. -- Joseph S. Myers josmy...@redhat.com