]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/41162 (416.gamess in SPEC CPU 2006 failed to build)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 25 Aug 2009 05:22:14 +0000 (05:22 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 25 Aug 2009 05:22:14 +0000 (05:22 +0000)
2009-08-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/41162
* io.c (check_format): Fix to not error on slash after P. Fix some
error loci.

From-SVN: r151074

gcc/fortran/ChangeLog
gcc/fortran/io.c

index 330ced87abc3cd5f265025be185cef1359014396..15881c94ca0d083890233ef5d285bc4503598d2a 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/41162
+       * io.c (check_format): Fix to not error on slash after P. Fix some
+       error loci.
+       
 2009-08-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/41154
index 239d1e27a1a6f42ba848bcc4bba275ba1e795567..a0a4356de39e0a5c339fc1bdb69fcb5a4ee5e6ed 100644 (file)
@@ -694,7 +694,7 @@ data_desc:
        goto fail;
       if (gfc_option.allow_std < GFC_STD_F2003 && t != FMT_COMMA
          && t != FMT_F && t != FMT_E && t != FMT_EN && t != FMT_ES
-         && t != FMT_D && t != FMT_G && t != FMT_RPAREN)
+         && t != FMT_D && t != FMT_G && t != FMT_RPAREN && t != FMT_SLASH)
        {
          error = _("Comma required after P descriptor");
          goto syntax;
@@ -708,7 +708,7 @@ data_desc:
                goto fail;
            }
           if (t != FMT_F && t != FMT_E && t != FMT_EN && t != FMT_ES && t != FMT_D
-             && t != FMT_G && t != FMT_RPAREN)
+             && t != FMT_G && t != FMT_RPAREN && t != FMT_SLASH)
            {
              error = _("Comma required after P descriptor");
              goto syntax;
@@ -839,6 +839,9 @@ data_desc:
            gfc_warning ("Period required in format "
                         "specifier %s at %L", token_to_string (t),
                          &format_locus);
+         /* If we go to finished, we need to unwind this
+            before the next round.  */
+         format_locus.nextc -= format_string_pos;
          saved_token = u;
          break;
        }
@@ -1009,6 +1012,10 @@ between_desc:
       if (gfc_notify_std (GFC_STD_GNU, "Extension: Missing comma at %L",
          &format_locus) == FAILURE)
        return FAILURE;
+      /* If we do not actually return a failure, we need to unwind this
+         before the next round.  */
+      if (mode != MODE_FORMAT)
+       format_locus.nextc -= format_string_pos;
       goto format_item_1;
     }
 
@@ -1068,6 +1075,10 @@ extension_optional_comma:
       if (gfc_notify_std (GFC_STD_GNU, "Extension: Missing comma at %L",
          &format_locus) == FAILURE)
        return FAILURE;
+      /* If we do not actually return a failure, we need to unwind this
+         before the next round.  */
+      if (mode != MODE_FORMAT)
+       format_locus.nextc -= format_string_pos;
       saved_token = t;
       break;
     }