This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/68569] ICE with automatic character object and DATA


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

--- Comment #4 from Nicolas Koenig <koenigni at gcc dot gnu.org> ---
And here is a fix for the first test case (z2a.f90), already regression tested
on x86_64-pc-linux-gnu:

Index: resolve.c
===================================================================
--- resolve.c   (revision 246743)
+++ resolve.c   (working copy)
@@ -14947,6 +14947,12 @@ check_data_variable (gfc_data_variable *var, locus
          }
     }

+  if (e->ts.type == BT_CHARACTER && e->ts.u.cl->length
+        && e->ts.u.cl->length->expr_type == EXPR_VARIABLE)
+    gfc_error("Nonconstant length character at %L in DATA statement",
+              &e->where);
+  
+
   if (e->rank == 0 || has_pointer)
     {
       mpz_init_set_ui (size, 1);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]