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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>:

https://gcc.gnu.org/g:b980edba506442c846cc779243ceeffd13065740

commit r11-7729-gb980edba506442c846cc779243ceeffd13065740
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.

Reply via email to