It turned out that this patch did not quite complete the job (Thanks Walt): The ICE has gone but reallocation on assignment is not occurring because the correct string length for the rhs expression was not being picked up. The fix for this took rather more detective work than I anticipated but here it is. Bootstraps and regtests on FC28/x86_64 - OK for trunk? Cheers Paul 2018-10-18 Paul Thomas PR fortran/85603 * frontend-passes.c (get_len_call): New function to generate a call to intrinsic LEN. (create_var): Use this to make length expressions for variable rhs string lengths. Clean up some white space issues. 2018-10-18 Paul Thomas PR fortran/85603 * gfortran.dg/deferred_character_23.f90 : Check reallocation is occurring as it should.. On Sat, 22 Sep 2018 at 11:23, Paul Richard Thomas wrote: > > Yet another 'obvious' deferred character fix. Committed to trunk as > r264502. Will backport in about ten days time. > > Paul > > 2018-09-22 Paul Thomas > > PR fortran/85603 > * trans-array.c (gfc_alloc_allocatable_for_assignment): Test > the charlen backend_decl before using the VAR_P macro. > > 2018-09-22 Paul Thomas > > PR fortran/85603 > * gfortran.dg/deferred_character_23.f90 : New test. -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein