Dear all, two almost obvious, trivial issues issues with NULL pointer dereferences. Steve found the locations, but his solution changes the error messages as compared to 7/8. I've chosen the conservative way which keeps the documented intent of the source code. Regtested on x86_64-pc-linux-gnu. OK for master? Backport to affected 10- and 9-branches? (8.4.1 was/is fine). Thanks, Harald PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913 Add checks for NULL pointers before dereferencing them. gcc/fortran/ChangeLog: PR fortran/95342 * decl.c (gfc_match_function_decl): Avoid NULL pointer dereference. (gfc_match_subroutine): Likewise. gcc/testsuite/ChangeLog: PR fortran/95342 * gfortran.dg/pr95342.f90: New test.