From 67b8d50c647986eda5e72f8924ae24ca44d89720 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Thu, 24 May 2018 23:28:35 +0000 Subject: [PATCH] re PR fortran/85780 (ICE in resolve_fl_procedure, at fortran/resolve.c:12504) 2018-05-24 Steven G. Kargl PR fortran/85780 * resolve.c (resolve_fl_procedure): Avoid NULL dereference. 2018-05-24 Steven G. Kargl PR fortran/85780 * gfortran.dg/pr85780.f90: New test. From-SVN: r260698 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/resolve.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/pr85780.f90 | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/pr85780.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 534b27722c0..9410c52f8b6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-05-24 Steven G. Kargl + + PR fortran/85780 + * resolve.c (resolve_fl_procedure): Avoid NULL dereference. + 2018-05-24 Steven G. Kargl PR fortran/85779 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index a53253ea88b..434c532257a 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -12503,7 +12503,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) while (curr_arg != NULL) { /* Skip implicitly typed dummy args here. */ - if (curr_arg->sym->attr.implicit_type == 0) + if (curr_arg->sym && curr_arg->sym->attr.implicit_type == 0) if (!gfc_verify_c_interop_param (curr_arg->sym)) /* If something is found to fail, record the fact so we can mark the symbol for the procedure as not being diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8273fca099e..fec1fca5d18 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-05-24 Steven G. Kargl + + PR fortran/85780 + * gfortran.dg/pr85780.f90: New test. + 2018-05-24 Steven G. Kargl PR fortran/85779 diff --git a/gcc/testsuite/gfortran.dg/pr85780.f90 b/gcc/testsuite/gfortran.dg/pr85780.f90 new file mode 100644 index 00000000000..ad6b27fc4db --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr85780.f90 @@ -0,0 +1,5 @@ +! { dg-do compile } +! { dg-options "-std=legacy" } +! PR fortran/85780 +subroutine s(*) bind(c) +end -- 2.30.2