https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113503
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- It is the PR fortran/82774 (alloc_scalar_allocatable_subcomponent): Shorten the function name and replace the symbol argument with the se string length. If a deferred length character length is either not present or is not a variable, give the typespec a variable and assign the string length to that. Use gfc_deferred_strlen to find the hidden string length component. (gfc_trans_subcomponent_assign): Convert the expression before the call to alloc_scalar_allocatable_subcomponent so that a good string length is provided. (gfc_trans_structure_assign): Remove the unneeded derived type symbol from calls to gfc_trans_subcomponent_assign. part of the changes that cause this, reverting those hunks (had to revert one manually as tree size; declaration has been added there later) makes the testcase not warn anymore or in the other case not ICE anymore.