re PR fortran/77583 (ICE in pp_quoted_string, at pretty-print.c:966)
authorHarald Anlauf <anlauf@gmx.de>
Sun, 3 Mar 2019 20:24:53 +0000 (20:24 +0000)
committerHarald Anlauf <anlauf@gcc.gnu.org>
Sun, 3 Mar 2019 20:24:53 +0000 (20:24 +0000)
2019-03-03  Harald Anlauf  <anlauf@gmx.de>
    Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/77583
* symbol.c (check_conflict): Check for valid procedure name
passed to error reporting routine.

PR fortran/77583
* gfortran.dg/pr77583.f90: New test.

Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
From-SVN: r269353

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

index 489ae1bc0cb4ea95ae28196e124de308d94d3e71..9f4234900b6880cc7fb3b6d9a3abd67381c52165 100644 (file)
@@ -1,3 +1,10 @@
+2019-03-03  Harald Anlauf  <anlauf@gmx.de>
+           Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/77583
+       * symbol.c (check_conflict): Check for valid procedure name
+       passed to error reporting routine.
+
 2019-03-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/72714
index c8a1f842d353f877e0697162d4f7224c93344b0f..0eb413084d14bd4561966a893ffec0f438d77646 100644 (file)
@@ -525,7 +525,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
   /* The copying of procedure dummy arguments for module procedures in
      a submodule occur whilst the current state is COMP_CONTAINS. It
      is necessary, therefore, to let this through.  */
-  if (attr->dummy
+  if (name && attr->dummy
       && (attr->function || attr->subroutine)
       && gfc_current_state () == COMP_CONTAINS
       && !(gfc_new_block && gfc_new_block->abr_modproc_decl))
index e7b54ea788216df7dff1cb8dd42a73d0ac509037..4e8fd0242cfbf8266c12a677e02810631e267c09 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-03  Harald Anlauf  <anlauf@gmx.de>
+
+       PR fortran/77583
+       * gfortran.dg/pr77583.f90: New test.
+
 2019-03-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/72714
diff --git a/gcc/testsuite/gfortran.dg/pr77583.f90 b/gcc/testsuite/gfortran.dg/pr77583.f90
new file mode 100644 (file)
index 0000000..c2ee074
--- /dev/null
@@ -0,0 +1,10 @@
+! { dg-do compile }
+!
+! PR fortran/77583 - ICE in pp_quoted_string, at pretty-print.c:966
+! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
+
+pure subroutine sub(s)
+contains
+   pure subroutine s  ! { dg-error "conflicts with DUMMY argument" }
+   end
+end