[PATCH, libgfortran] PR83387 Defined output does not work for a derived type that has no components

Jerry DeLisle jvdelisle@charter.net
Sat Feb 23 08:22:00 GMT 2019


This patch is simple and obvious.

Regression tested on x86_64-pc-linux-gnu.

Test case attached. (Changelog for test case will be included)

I will commit tomorrow.

Regards,

Jerry

2019-02-23  Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR fortran/84387
	* trans-io.c (transfer_expr): Do not return if there are no
	components to the derived type or class.


diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 9a13af4a630..9e7071dc121 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -2407,8 +2407,6 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr,

      case_bt_struct:
      case BT_CLASS:
-      if (ts->u.derived->components == NULL)
-       return;
        if (gfc_bt_struct (ts->type) || ts->type == BT_CLASS)
         {
           gfc_symbol *derived;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dtio_34.f90
Type: text/x-fortran
Size: 912 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190223/c01d8172/attachment.bin>


More information about the Gcc-patches mailing list