https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90561

--- Comment #8 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This

Index: trans-expr.c
===================================================================
--- trans-expr.c        (Revision 274370)
+++ trans-expr.c        (Arbeitskopie)
@@ -10796,7 +10796,13 @@
       if (expr1->ts.deferred
          && gfc_expr_attr (expr1).allocatable
          && gfc_check_dependency (expr1, expr2, true))
-       rse.string_length = gfc_evaluate_now (rse.string_length, &rse.pre);
+       {
+         /* Add the variable to function scope.  */
+         tree string_length;
+         string_length = gfc_create_var_np (TREE_TYPE (rse.string_length),
NULL);
+         gfc_add_decl_to_function (string_length);
+         gfc_add_modify (&rse.pre, rse.string_length, string_length);
+       }
       string_length = rse.string_length;
     }
   else

gets rid of the ICE, but introduces new ones (and the run-time behavior
of the code is wrong, if one adds print *,z at the end of z1.f90).

Reply via email to