https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100337
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Andre Vehreschild <ve...@gcc.gnu.org>: https://gcc.gnu.org/g:ae57aae60d1be821feccb3160f8fdd5987ecba79 commit r11-9568-gae57aae60d1be821feccb3160f8fdd5987ecba79 Author: Andre Vehreschild <ve...@gcc.gnu.org> Date: Mon Feb 14 16:47:16 2022 +0100 fortran: Fix deref of optional in gen. code. [PR100337, backport] gcc/fortran/ChangeLog: PR fortran/100337 Backport from master. * 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.