[patch,fortran] [4.5 Regression] 416.gamess in SPEC CPU 2006 failed to build

Jerry DeLisle jvdelisle@verizon.net
Tue Aug 25 11:41:00 GMT 2009


I will commit the following under obvious and simple after regression 
testing finishes. I will also add this case to fmt_error_8.f

write (*,'(1X,"INITIAL VALUE OF CHISQ =",1P,E17.10,0P/)') 1.0d0

The patch also makes some locus adjustments.  Only because this is what 
I was working on when the bug report came in.

Once again, sorry for breakage.

Jerry

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.


Index: io.c
===================================================================
--- io.c	(revision 151070)
+++ io.c	(working copy)
@@ -694,7 +694,7 @@
  	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 @@
  		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 @@
  	    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 @@
        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 @@
        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;
      }



More information about the Gcc-patches mailing list