re PR fortran/87907 (ICE in resolve_contained_fntype, at fortran/resolve.c:587)

2019-06-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/87907
	* resolve.c (resolve_contained_fntype): Do not dereference a NULL
	pointer.

2019-06-19  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/87907
	* gfortran.dg/pr87907.f90: New testcase.

From-SVN: r272480
This commit is contained in:
Steven G. Kargl 2019-06-19 17:58:54 +00:00
parent 33f0ad50f4
commit ee3aab6826
4 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87907
* resolve.c (resolve_contained_fntype): Do not dereference a NULL
pointer.
2019-06-19 Jim MacArthur <jim.macarthur@codethink.co.uk>
Mark Eggleston <mark.eggleston@codethink.com>

View File

@ -583,6 +583,9 @@ resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
|| sym->attr.entry_master)
return;
if (!sym->result)
return;
/* Try to find out of what the return type is. */
if (sym->result->ts.type == BT_UNKNOWN && sym->result->ts.interface == NULL)
{

View File

@ -1,3 +1,8 @@
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87907
* gfortran.dg/pr87907.f90: New testcase.
2019-06-19 Wilco Dijkstra <wdijkstr@arm.com>
PR middle-end/84521

View File

@ -0,0 +1,23 @@
! { dg-do compile }
! PR fortran/pr87907
! Original testcase contributed by Gerhard Stienmetz <gscfq at t-online dot de>
module m
interface
module function g(x) result(z)
integer, intent(in) :: x
integer, allocatable :: z
end
end interface
end
submodule(m) m2
contains
subroutine g(x) ! { dg-error "mismatch in argument" }
end
end
program p
use m ! { dg-error "has a type" }
integer :: x = 3
call g(x) ! { dg-error "which is not consistent with" }
end