aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-08-25 05:22:14 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-08-25 05:22:14 +0000
commitc50d968717f1737cff7c238df166906aed8bab3a (patch)
treec64b5a0c557c6649b2e91acea6d6ab1955ed2f5e /gcc/fortran/io.c
parent4551438c75836ee380e2bf840f2646fda23e3743 (diff)
downloadgcc-c50d968717f1737cff7c238df166906aed8bab3a.zip
gcc-c50d968717f1737cff7c238df166906aed8bab3a.tar.gz
gcc-c50d968717f1737cff7c238df166906aed8bab3a.tar.bz2
re PR fortran/41162 (416.gamess in SPEC CPU 2006 failed to build)
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
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 239d1e2..a0a4356 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -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;
}