https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100337
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andre Vehreschild <ve...@gcc.gnu.org>: https://gcc.gnu.org/g:da13e4ebebb07a47d5fb50eab8893f8fe38683df commit r12-1741-gda13e4ebebb07a47d5fb50eab8893f8fe38683df Author: Andre Vehreschild <ve...@gcc.gnu.org> Date: Wed Jun 23 10:09:29 2021 +0200 fortran: Fix deref of optional in gen. code. [PR100337] gcc/fortran/ChangeLog: PR fortran/100337 * trans-intrinsic.c (conv_co_collective): Check stat for null ptr before dereferrencing. gcc/testsuite/ChangeLog: PR fortran/100337 * gfortran.dg/coarray_collectives_17.f90: New test.