https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103634
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:1c613165a55b212c59a83796b20a1d555e096504 commit r12-5961-g1c613165a55b212c59a83796b20a1d555e096504 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.