This problem was caused by the compiler attempting to use 0 as an lvalue and to assign 0 to it. Understandably, this upset the gimplifer quite a bit :-) The fix is to use the ss_info string length for deferred length character components, where the hidden string length component has been used. The use of a constant as an lvalue is prevented by checking that the expression string length is a variable. Regtests on FC33/x86_64 - OK for all three branches? Paul Fortran: Fix for class defined operators [PR99125]. 2021-02-23 Paul Thomas gcc/fortran PR fortran/99125 * trans-array.c (gfc_conv_expr_descriptor): For deferred length length components use the ss_info string length instead of gfc_get_expr_charlen. Make sure that the deferred string length is a variable before assigning to it. Otherwise use the expr. * trans-expr.c (gfc_conv_string_length): Make sure that the deferred string length is a variable before assigning to it. gcc/testsuite/ PR fortran/99125 * gfortran.dg/alloc_deferred_comp_1.f90: New test.