https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125763
Mikael Morin <mikael at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikael at gcc dot gnu.org
--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #1)
> Created attachment 64774 [details]
> Patch for preliminary review
It's a bit late to fix it at code generation time IMHO.
resolve_values calls gfc_resolve_expr on sym->value; which has:
if (e->ts.type == BT_CHARACTER && e->ts.u.cl == NULL && e->ref
&& e->ref->type != REF_SUBSTRING)
gfc_resolve_substring_charlen (e);
The condition in your patch is ts.u.cl && ts.u.cl->length == NULL so the
condition in gfc_resolve_expr doesn't work. So one could amend the condition
in gfc_resolve_expr or one could see where ts.u.cl is set and see why the
string length is created but the length fails to be set.