https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93210
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 47628 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47628&action=edit gcc10-pr93210-wip.patch Untested patch that fixes this, by moving native_encode_initializer from dwarf2out.c to fold-const.c, adjusting it to handle native_encode_expr compatible arguments (e.g. being able to do a dry run or pick just a few bytes from the middle of larger object) and use it in fold_ctor_reference (toplevel only, otherwise it could be exponential complexity).