summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-13 20:41:00 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-13 20:41:00 +0000
commitcbb040a1b2cdac76cfbe58c05a7f560516a65cd2 (patch)
tree3a36687995781a9d97613d60463d8da90be8f6d7
parent6595f9c7e85315fde134417e612832d03a584282 (diff)
downloadgcc-cbb040a1b2cdac76cfbe58c05a7f560516a65cd2.tar.gz
2018-01-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/82007 * resolve.c (resolve_transfer): Delete code looking for 'DT' format specifiers in format strings. Set formatted to true if a format string or format label is present. * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix whitespace. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256649 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog9
-rw-r--r--gcc/fortran/resolve.c16
-rw-r--r--gcc/fortran/trans-io.c25
3 files changed, 16 insertions, 34 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d7ec5806f82..75331718092 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,12 @@
+2018-01-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/82007
+ * resolve.c (resolve_transfer): Delete code looking for 'DT'
+ format specifiers in format strings. Set formatted to true if a
+ format string or format label is present.
+ * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
+ whitespace.
+
2018-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/83744
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index e9f91d883ef..67568710b05 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -9198,19 +9198,9 @@ resolve_transfer (gfc_code *code)
else
derived = ts->u.derived->components->ts.u.derived;
- if (dt->format_expr)
- {
- char *fmt;
- fmt = gfc_widechar_to_char (dt->format_expr->value.character.string,
- -1);
- if (strtok (fmt, "DT") != NULL)
- formatted = true;
- }
- else if (dt->format_label == &format_asterisk)
- {
- /* List directed io must call the formatted DTIO procedure. */
- formatted = true;
- }
+ /* Determine when to use the formatted DTIO procedure. */
+ if (dt && (dt->format_expr || dt->format_label))
+ formatted = true;
write = dt->dt_io_kind->value.iokind == M_WRITE
|| dt->dt_io_kind->value.iokind == M_PRINT;
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 9eb77e5986d..082b9f7a52f 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -2227,25 +2227,9 @@ get_dtio_proc (gfc_typespec * ts, gfc_code * code, gfc_symbol **dtio_sub)
bool formatted = false;
gfc_dt *dt = code->ext.dt;
- if (dt)
- {
- 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;
-
- }
+ /* Determine when to use the formatted DTIO procedure. */
+ if (dt && (dt->format_expr || dt->format_label))
+ formatted = true;
if (ts->type == BT_CLASS)
derived = ts->u.derived->components->ts.u.derived;
@@ -2455,8 +2439,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr,
{
/* Recurse into the elements of the derived type. */
expr = gfc_evaluate_now (addr_expr, &se->pre);
- expr = build_fold_indirect_ref_loc (input_location,
- expr);
+ expr = build_fold_indirect_ref_loc (input_location, expr);
/* Make sure that the derived type has been built. An external
function, if only referenced in an io statement, requires this