Hello world, the attached patch fixes an ICE where a NULL check was missing. Committed as obvious and simple after regression-testing as r279087.
Since this is an ICE after an error has already been emitted, I don't see any particular need to backport. Regards Thomas 2018-12-08 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/92764 * interface.c (gfc_procedure_use): Check for existence of derived component before using (twice). 2018-12-08 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/92764 * gfortran.dg/interface_44.f90: New test.
Index: interface.c =================================================================== --- interface.c (Revision 279064) +++ interface.c (Arbeitskopie) @@ -3888,6 +3888,7 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arg /* F2008, C1303 and C1304. */ if (a->expr && (a->expr->ts.type == BT_DERIVED || a->expr->ts.type == BT_CLASS) + && a->expr->ts.u.derived && ((a->expr->ts.u.derived->from_intmod == INTMOD_ISO_FORTRAN_ENV && a->expr->ts.u.derived->intmod_sym_id == ISOFORTRAN_LOCK_TYPE) || gfc_expr_attr (a->expr).lock_comp)) @@ -3901,6 +3902,7 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arg if (a->expr && (a->expr->ts.type == BT_DERIVED || a->expr->ts.type == BT_CLASS) + && a->expr->ts.u.derived && ((a->expr->ts.u.derived->from_intmod == INTMOD_ISO_FORTRAN_ENV && a->expr->ts.u.derived->intmod_sym_id == ISOFORTRAN_EVENT_TYPE)
! { dg-do compile } ! PR 92964 - this used to ICE. ! Original test case by Arseny Solokha type(e6) function dn() ! { dg-error "The type for function" } call sub(dn) end function dn