https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103634
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:39264acd7daaff4659fefa005ec02bccf685447d commit r10-10363-g39264acd7daaff4659fefa005ec02bccf685447d Author: Harald Anlauf <anl...@gmx.de> Date: Mon Dec 13 20:50:19 2021 +0100 Fortran: PACK intrinsic should not try to read from zero-sized array libgfortran/ChangeLog: PR libfortran/103634 * intrinsics/pack_generic.c (pack_internal): Handle case when the array argument of PACK has one or more extents of size zero to avoid invalid reads. gcc/testsuite/ChangeLog: PR libfortran/103634 * gfortran.dg/intrinsic_pack_6.f90: New test. (cherry picked from commit 1c613165a55b212c59a83796b20a1d555e096504)