https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99641
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>: https://gcc.gnu.org/g:376f564b870a0afa64403a9aaf9f0ff1fc7153cf commit r10-9458-g376f564b870a0afa64403a9aaf9f0ff1fc7153cf Author: Eric Botcazou <ebotca...@adacore.com> Date: Fri Mar 19 09:21:11 2021 +0100 Fix segfault during encoding of CONSTRUCTORs The segfault occurs in native_encode_initializer when it is encoding the CONSTRUCTOR for an array whose lower bound is negative (it's OK in Ada). The computation of the current position is done in HOST_WIDE_INT and this does not work for arrays whose original range has a negative lower bound and a positive upper bound; the computation must be done in sizetype instead so that it may wrap around. gcc/ PR middle-end/99641 * fold-const.c (native_encode_initializer) <CONSTRUCTOR>: For an array type, do the computation of the current position in sizetype.