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

Backport from trunk
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: r269355

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

index b30685de60bc162228dd78ebc418fd40e02c0b26..c987e1ba15d967cf664d138b4b02c685633fc286 100644 (file)
@@ -1,3 +1,11 @@
+2019-03-03  Harald Anlauf  <anlauf@gmx.de>
+           Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       Backport from trunk
+       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/87689
index 6917b22dff28c3c5fc7141c7d9136e0e0620c634..7b884c332102eeffcd7295542cbf6259f69c353b 100644 (file)
@@ -477,7 +477,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 1ea2c1fe2191fe0fb1c3934a2a07fbc20c11b20b..257e2823dae183b01e182016262de9c53b7127fb 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-03  Harald Anlauf  <anlauf@gmx.de>
+
+       Backport from trunk
+       PR fortran/77583
+       * gfortran.dg/pr77583.f90: New test.
+
 2019-03-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/87689
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