Committed a partial patch as 'obvious' in revision 257363. Oddly, the failing test in associate_35.f90 is the only one that works in 7-branch. I have left the PR open and changed the title accordingly.
Paul 2018-02-04 Paul Thomas <pa...@gcc.gnu.org> PR fortran/84115 * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of 'length' if the symbol charlen backend_decl is an indirect ref. 2018-02-04 Paul Thomas <pa...@gcc.gnu.org> PR fortran/84115 * gfortran.dg/associate_34.f90: New test. * gfortran.dg/associate_35.f90: New test.