https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92781
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Thu Dec 5 09:03:34 2019 New Revision: 278988 URL: https://gcc.gnu.org/viewcvs?rev=278988&root=gcc&view=rev Log: PR fortran/92781 * trans-decl.c (gfc_get_symbol_decl): If sym->backend_decl is current_function_decl, add length to current rather than parent function and expect DECL_CONTEXT (length) to be current_function_decl. * gfortran.dg/pr92781.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/pr92781.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-decl.c trunk/gcc/testsuite/ChangeLog