diff options
Diffstat (limited to 'gcc/fortran/trans-io.c')
-rw-r--r-- | gcc/fortran/trans-io.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index c3c56f2..aa974eb 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -2214,18 +2214,24 @@ get_dtio_proc (gfc_typespec * ts, gfc_code * code, gfc_symbol **dtio_sub) bool formatted = false; gfc_dt *dt = code->ext.dt; - if (dt && dt->format_expr) + if (dt) { - char *fmt; - fmt = gfc_widechar_to_char (dt->format_expr->value.character.string, - -1); - if (strtok (fmt, "DT") != NULL) + char *fmt = NULL; + + if (dt->format_label == &format_asterisk) + { + /* List directed io must call the formatted DTIO procedure. */ + formatted = true; + } + else if (dt->format_expr) + fmt = gfc_widechar_to_char (dt->format_expr->value.character.string, + -1); + else if (dt->format_label) + fmt = gfc_widechar_to_char (dt->format_label->format->value.character.string, + -1); + if (fmt && strtok (fmt, "DT") != NULL) formatted = true; - } - else if (dt && dt->format_label == &format_asterisk) - { - /* List directed io must call the formatted DTIO procedure. */ - formatted = true; + } if (ts->type == BT_CLASS) |