https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83864
Harald Anlauf <anlauf at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de --- Comment #3 from Harald Anlauf <anlauf at gmx dot de> --- The trivial check on valid length Index: gcc/fortran/expr.c =================================================================== --- gcc/fortran/expr.c (revision 256671) +++ gcc/fortran/expr.c (working copy) @@ -4267,7 +4269,7 @@ gfc_set_constant_character_len (len, init, -1); else if (init && init->ts.type == BT_CHARACTER - && init->ts.u.cl + && init->ts.u.cl && init->ts.u.cl->length && mpz_cmp (ts->u.cl->length->value.integer, init->ts.u.cl->length->value.integer)) { makes the code in comment #0 compile. Haven't tried whether it works properly.