https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107423
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-10-27 Status|UNCONFIRMED |NEW Priority|P3 |P4 Ever confirmed|0 |1 Keywords|ice-on-valid-code |ice-on-invalid-code CC| |kargl at gcc dot gnu.org --- Comment #1 from kargl at gcc dot gnu.org --- It is actually an ICE on invalid code as type-params were added in F2008 or F2018. This is an ICE caused by run-on errors where a NULL pointer is dereferenced. Fixed by diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc index 5b13441912a..25b987c7bef 100644 --- a/gcc/fortran/parse.cc +++ b/gcc/fortran/parse.cc @@ -3994,7 +3994,7 @@ parse_spec (gfc_statement st) gfc_symbol* proc = gfc_current_ns->proc_name; gcc_assert (proc); - if (proc->result->ts.type == BT_UNKNOWN) + if (proc->result && proc->result->ts.type == BT_UNKNOWN) function_result_typed = true; }