diff mbox series

[fortran,committed] Fix part 2 of PR 83224

Message ID f46285ff-40f2-3ecb-afd1-6703f2e1e7eb@netcologne.de
State New
Headers show
Series [fortran,committed] Fix part 2 of PR 83224 | expand

Commit Message

Thomas Koenig Dec. 1, 2017, 6:06 p.m. UTC
Hello world,

I have committed the fix for the second part (and original
test case) of PR 83224 as obvious after regression-testing
as r255331.

Regards

	Thomas

2017-12-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/83224
	* frontend-passes.c (create_var): Also handle
	character arrays, handling deferred lenghts.

2017-12-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/83224
	* gfortran.dg/dependency_51.f90: New test.
diff mbox series

Patch

Index: frontend-passes.c
===================================================================
--- frontend-passes.c	(Revision 255294)
+++ frontend-passes.c	(Arbeitskopie)
@@ -767,7 +767,7 @@  create_var (gfc_expr * e, const char *vname)
     }
 
   deferred = 0;
-  if (e->ts.type == BT_CHARACTER && e->rank == 0)
+  if (e->ts.type == BT_CHARACTER)
     {
       gfc_expr *length;
 
@@ -778,6 +778,8 @@  create_var (gfc_expr * e, const char *vname)
       else
 	{
 	  symbol->attr.allocatable = 1;
+	  symbol->ts.u.cl->length = NULL;
+	  symbol->ts.deferred = 1;
 	  deferred = 1;
 	}
     }
@@ -790,7 +792,7 @@  create_var (gfc_expr * e, const char *vname)
 
   result = gfc_get_expr ();
   result->expr_type = EXPR_VARIABLE;
-  result->ts = e->ts;
+  result->ts = symbol->ts;
   result->ts.deferred = deferred;
   result->rank = e->rank;
   result->shape = gfc_copy_shape (e->shape, e->rank);