I have had this simple patch in my trunk for quite some time and it has tested OK.
I plan to commit with a test case based on the one in the PR today. Regards, Jerry 2015-04-21 Jerry DeLisle <jvdeli...@gcc.gnu.org> PR libgfortran/65234 * io/format.c (parse_format_list): Set the seen_dd flag in all cases where a data descriptor has been seen.
Index: format.c =================================================================== --- format.c (revision 222194) +++ format.c (working copy) @@ -624,6 +624,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see get_fnode (fmt, &head, &tail, FMT_LPAREN); tail->repeat = -2; /* Signifies unlimited format. */ tail->u.child = parse_format_list (dtp, &seen_data_desc); + *seen_dd = seen_data_desc; if (fmt->error != NULL) goto finished; if (!seen_data_desc) @@ -851,6 +852,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see switch (t) { case FMT_L: + *seen_dd = true; t = format_lex (fmt); if (t != FMT_POSINT) { @@ -873,6 +875,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see break; case FMT_A: + *seen_dd = true; t = format_lex (fmt); if (t == FMT_ZERO) { @@ -897,6 +900,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see case FMT_G: case FMT_EN: case FMT_ES: + *seen_dd = true; get_fnode (fmt, &head, &tail, t); tail->repeat = repeat; @@ -903,6 +907,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see u = format_lex (fmt); if (t == FMT_G && u == FMT_ZERO) { + *seen_dd = true; if (notification_std (GFC_STD_F2008) == NOTIFICATION_ERROR || dtp->u.p.mode == READING) { @@ -928,6 +933,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see } if (t == FMT_F && dtp->u.p.mode == WRITING) { + *seen_dd = true; if (u != FMT_POSINT && u != FMT_ZERO) { fmt->error = nonneg_required; @@ -969,9 +975,11 @@ parse_format_list (st_parameter_dt *dtp, bool *see tail->u.real.e = -1; if (t2 == FMT_D || t2 == FMT_F) - break; + { + *seen_dd = true; + break; + } - /* Look for optional exponent */ t = format_lex (fmt); if (t != FMT_E) @@ -1011,6 +1019,7 @@ parse_format_list (st_parameter_dt *dtp, bool *see case FMT_B: case FMT_O: case FMT_Z: + *seen_dd = true; get_fnode (fmt, &head, &tail, t); tail->repeat = repeat;