This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/69867] ICE on initializing character in type with array of incompatible data
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 03 Jul 2016 06:04:53 +0000
- Subject: [Bug fortran/69867] ICE on initializing character in type with array of incompatible data
- Auto-submitted: auto-generated
- References: <bug-69867-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69867
--- Comment #5 from kargl at gcc dot gnu.org ---
Index: decl.c
===================================================================
--- decl.c (revision 237945)
+++ decl.c (working copy)
@@ -1912,8 +1916,10 @@ build_struct (const char *name, gfc_char
if (c->initializer->expr_type == EXPR_CONSTANT)
gfc_set_constant_character_len (len, c->initializer, -1);
- else if (mpz_cmp (c->ts.u.cl->length->value.integer,
- c->initializer->ts.u.cl->length->value.integer))
+ else if (c->initializer
+ && c->initializer->ts.u.cl
+ && mpz_cmp (c->ts.u.cl->length->value.integer,
+ c->initializer->ts.u.cl->length->value.integer))
{
gfc_constructor *ctor;
ctor = gfc_constructor_first (c->initializer->value.constructor);