https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103719
--- Comment #2 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:e866e1c92ecf88feeeafd5d55348451c9a181f3c commit r12-5967-ge866e1c92ecf88feeeafd5d55348451c9a181f3c Author: Harald Anlauf <anl...@gmx.de> Date: Tue Dec 14 21:02:04 2021 +0100 Fortran: prevent NULL pointer dereferences checking do-loop contained stuff gcc/fortran/ChangeLog: PR fortran/103718 PR fortran/103719 * frontend-passes.c (doloop_contained_procedure_code): Add several checks to prevent NULL pointer dereferences on valid and invalid code called within do-loops. gcc/testsuite/ChangeLog: PR fortran/103718 PR fortran/103719 * gfortran.dg/do_check_18.f90: New test.