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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Iain Buclaw
<ibuc...@gcc.gnu.org>:

https://gcc.gnu.org/g:45be6e80884d452c927c24e43b9018e2aa141c64

commit r11-8809-g45be6e80884d452c927c24e43b9018e2aa141c64
Author: Iain Buclaw <ibuc...@gdcproject.org>
Date:   Mon Jul 26 15:11:42 2021 +0200

    d: fix ICE at convert_expr(tree_node*, Type*, Type*) (PR101490)

    Both the front-end and code generator had a modulo by zero bug when testing
if
    a conversion from a static array to dynamic array was valid.

            PR d/101490

    gcc/d/ChangeLog:

            * d-codegen.cc (build_array_index): Handle void arrays same as
byte.
            * d-convert.cc (convert_expr): Handle converting to zero-sized
arrays.
            * dmd/dcast.c (castTo): Handle casting to zero-sized arrays.

    gcc/testsuite/ChangeLog:

            * gdc.dg/pr101490.d: New test.
            * gdc.test/fail_compilation/fail22144.d: New test.

    (cherry picked from commit c936c39f86c74b3bfc6831f694b3165296c99dc0)

Reply via email to