Hi All, Jakub pinpointed the source of this bug in comment 6 of the PR. The rest was 'obvious' :-) I plan to push the patch to mainline in the next 24 hours unless there are opinions to the contrary. Backporting is proposed to occur a couple of weeks later. Best regards Paul Fortran: Generate new charlens for shared symbol typespecs [PR89462] 2024-04-23 Paul Thomas Jakub Jelinek gcc/fortran PR fortran/89462 * decl.cc (build_sym): Add an extra argument 'elem'. If 'elem' is greater than 1, gfc_new_charlen is called to generate a new charlen, registered in the symbol namespace. (variable_decl, enumerator_decl): Set the new argument in the calls to build_sym. gcc/testsuite/ PR fortran/89462 * gfortran.dg/pr89462.f90: New test.