This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68569] ICE with automatic character object and DATA
- From: "koenigni at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 07 Apr 2017 16:11:08 +0000
- Subject: [Bug fortran/68569] ICE with automatic character object and DATA
- Auto-submitted: auto-generated
- References: <bug-68569-4@http.gcc.gnu.org/bugzilla/>
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);