re PR fortran/85780 (ICE in resolve_fl_procedure, at fortran/resolve.c:12504)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Thu, 24 May 2018 23:28:35 +0000 (23:28 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Thu, 24 May 2018 23:28:35 +0000 (23:28 +0000)
2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85780
* resolve.c (resolve_fl_procedure): Avoid NULL dereference.

2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/85780
* gfortran.dg/pr85780.f90: New test.

From-SVN: r260698

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr85780.f90 [new file with mode: 0644]

index 534b27722c02825d5457bdbfe4ece0575e8db931..9410c52f8b6cddb5f905db9d62b7220bd9f0cec1 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/85780
+       * resolve.c (resolve_fl_procedure): Avoid NULL dereference.
+
 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/85779
index a53253ea88b2b7e950eb8414e99288215fa6910f..434c532257a5746c9e8d44c1e6bb19637f0c941f 100644 (file)
@@ -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
index 8273fca099e2cd26db341aabaadbf7e2f2c152f4..fec1fca5d18bdf4d66699f0dfd9b8bf80819ef13 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/85780
+       * gfortran.dg/pr85780.f90: New test.
+
 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/85779
diff --git a/gcc/testsuite/gfortran.dg/pr85780.f90 b/gcc/testsuite/gfortran.dg/pr85780.f90
new file mode 100644 (file)
index 0000000..ad6b27f
--- /dev/null
@@ -0,0 +1,5 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+! PR fortran/85780
+subroutine s(*) bind(c)
+end