https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87477
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Paul Thomas <pa...@gcc.gnu.org>: https://gcc.gnu.org/g:d08f2e4f74583e27002368989bba197f8eb7f6d2 commit r14-1629-gd08f2e4f74583e27002368989bba197f8eb7f6d2 Author: Paul Thomas <pa...@gcc.gnu.org> Date: Thu Jun 8 07:11:32 2023 +0100 Fortran: Fix some more blockers in associate meta-bug [PR87477] 2023-06-08 Paul Thomas <pa...@gcc.gnu.org> gcc/fortran PR fortran/87477 PR fortran/99350 PR fortran/107821 PR fortran/109451 * decl.cc (char_len_param_value): Simplify a copy of the expr and replace the original if there is no error. * gfortran.h : Remove the redundant field 'rankguessed' from 'gfc_association_list'. * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'. (resolve_variable): Associate names with constant or structure constructor targets cannot have array refs. * trans-array.cc (gfc_conv_expr_descriptor): Guard expression character length backend decl before using it. Suppress the assignment if lhs equals rhs. * trans-io.cc (gfc_trans_transfer): Scalarize transfer of associate variables pointing to a variable. Add comment. * trans-stmt.cc (trans_associate_var): Remove requirement that the character length be deferred before assigning the value returned by gfc_conv_expr_descriptor. Also, guard the backend decl before testing with VAR_P. gcc/testsuite/ PR fortran/99350 * gfortran.dg/pr99350.f90 : New test. PR fortran/107821 * gfortran.dg/associate_5.f03 : Changed error message. * gfortran.dg/pr107821.f90 : New test. PR fortran/109451 * gfortran.dg/associate_61.f90 : New test