]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/91587 (ICE in gfc_resolve_filepos, at fortran/io.c:2913)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 31 Aug 2019 03:27:45 +0000 (03:27 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 31 Aug 2019 03:27:45 +0000 (03:27 +0000)
2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91587
* io.c (match_filepos): MATCH_ERROR should branch to a syntax error.

2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91587
* gfortran.dg/pr91587.f90: New test.

From-SVN: r275241

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

index 3c607062fdfe75c1a7a2cbce41089b8219367810..52fbf853142ce5330a543a86dcf2d4900de5db88 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/91587
+       * io.c (match_filepos): MATCH_ERROR should branch to a syntax error.
+
 2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/91565
index 9828897852a5e75f2e16823b3fc9145f35d1a39b..b3d8696c030af416ba3ae78104c2221212c33cd9 100644 (file)
@@ -2804,7 +2804,7 @@ match_filepos (gfc_statement st, gfc_exec_op op)
 
   m = match_file_element (fp);
   if (m == MATCH_ERROR)
-    goto done;
+    goto syntax;
   if (m == MATCH_NO)
     {
       m = gfc_match_expr (&fp->unit);
index 6c46a5fd6bd9e311add2451c7b710270454d7abf..e0a24b33db4ac442fe0c90047a521a14851510c5 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/91587
+       * gfortran.dg/pr91587.f90: New test.
+
 2019-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/91565
diff --git a/gcc/testsuite/gfortran.dg/pr91587.f90 b/gcc/testsuite/gfortran.dg/pr91587.f90
new file mode 100644 (file)
index 0000000..c07735d
--- /dev/null
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR fortran/91587
+! Code contributed by Gerhard Steinmetz
+program p
+   backspace(err=!)  ! { dg-error "Syntax error in" }
+   flush(err=!)      ! { dg-error "Syntax error in" }
+   rewind(err=!)     ! { dg-error "Syntax error in" }
+end
+
+subroutine bar       ! An other matcher runs, and gives a different error.
+   endfile(err=!)    ! { dg-error "Expecting END" }
+end