http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50407
--- Comment #10 from Steve Kargl <sgk at troutmask dot apl.washington.edu>
2011-09-15 23:05:25 UTC ---
On Thu, Sep 15, 2011 at 10:53:17PM +0000, sgk at troutmask dot
apl.washington.edu wrote:
>
> putting a fairly ugly hack into match_dt_format to
> skip statement lable matching, I can get gfortran
> to give
>
> troutmask:sgk[266] gfc4x -o z b.f && ./z
> ok 16
> ok 6
> ok 12
>
It's not pretty, but it appears to work.
Index: io.c
===================================================================
--- io.c (revision 178782)
+++ io.c (working copy)
@@ -2548,17 +2554,24 @@ match_dt_format (gfc_dt *dt)
if ((m = gfc_match_st_label (&label)) == MATCH_YES)
{
- if (dt->format_expr != NULL || dt->format_label != NULL)
+ gfc_gobble_whitespace ();
+ if (gfc_peek_ascii_char () != '.')
{
- gfc_free_st_label (label);
- goto conflict;
- }
- if (gfc_reference_st_label (label, ST_LABEL_FORMAT) == FAILURE)
- return MATCH_ERROR;
+ if (dt->format_expr != NULL || dt->format_label != NULL)
+ {
+ gfc_free_st_label (label);
+ goto conflict;
+ }
- dt->format_label = label;
- return MATCH_YES;
+ if (gfc_reference_st_label (label, ST_LABEL_FORMAT) == FAILURE)
+ return MATCH_ERROR;
+
+ dt->format_label = label;
+ return MATCH_YES;
+ }
+ else
+ gfc_current_locus = where;
}
else if (m == MATCH_ERROR)
/* The label was zero or too large. Emit the correct diagnosis. */