https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101490
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:5a67fcd15dc42969dc97a9ebb292cd53f9bc0a16 commit r9-9650-g5a67fcd15dc42969dc97a9ebb292cd53f9bc0a16 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)