https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69962
--- Comment #3 from kargl at gcc dot gnu.org --- Index: decl.c =================================================================== --- decl.c (revision 237945) +++ decl.c (working copy) @@ -1485,10 +1485,14 @@ gfc_set_constant_character_len (int len, gfc_char_t *s; int slen; - gcc_assert (expr->expr_type == EXPR_CONSTANT); - if (expr->ts.type != BT_CHARACTER) return; + + if (expr->expr_type != EXPR_CONSTANT) + { + gfc_error_now ("CHARACTER length must be a constant at %L", &expr->where); + return; + } slen = expr->value.character.length; if (len != slen)