Dear All, Thanks to Dimitry Liakh for both reporting the problem and doing a lot of the diagnostic work. Once the offending line in a very complicated code was located, the fix was trivial. Generating a reduced testcase took rather longer :-) The comment in the testcase tells the story. The fix is a one-liner that follows immediately from the explanation. Bootstrapped and regtested on FC23/x86_64 - OK for trunk and 7-branch. Cheers Paul 2017-10-26 Paul Thomas PR fortran/81758 * trans-expr.c (trans_class_vptr_len_assignment): 'vptr_expr' must only be set if the right hand side expression is of class type. 2017-10-26 Paul Thomas PR fortran/81758 * gfortran.dg/class_63.f90: New test.