https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91942

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
Index: gcc/fortran/io.c
===================================================================
--- gcc/fortran/io.c    (revision 276271)
+++ gcc/fortran/io.c    (working copy)
@@ -1469,7 +1469,7 @@ match_vtag (const io_tag *tag, gfc_expr **v)
     return m;

   m = gfc_match (tag->value, &result);
-  if (m != MATCH_YES)
+  if (m != MATCH_YES || result->expr_type == EXPR_CONSTANT)
     {
       gfc_error ("Invalid value for %s specification at %C", tag->name);
       return MATCH_ERROR;
@@ -2845,7 +2845,7 @@ match_filepos (gfc_statement st, gfc_exec_op op)

   m = match_file_element (fp);
   if (m == MATCH_ERROR)
-    goto syntax;
+    goto cleanup;
   if (m == MATCH_NO)
     {
       m = gfc_match_expr (&fp->unit);

Reply via email to