https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126170
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jerry DeLisle <[email protected]>: https://gcc.gnu.org/g:f935a7a9013d0748ba1f42dc532df3d278707bf6 commit r17-2320-gf935a7a9013d0748ba1f42dc532df3d278707bf6 Author: Jerry DeLisle <[email protected]> Date: Thu Jul 9 19:24:49 2026 -0700 fortran: [PR126170] Fix LTO ICE in copy_function_or_variable A redundant USE of a module already visible via host association, written inside a contained procedure, caused gfortran's module reader to create a second copy of that module's derived type. PR fortran/126170 gcc/fortran/ChangeLog: PR fortran/126170 * class.cc (gfc_find_derived_vtab): Fix up a stale non-use-associated duplicate vtab symbol. (gfc_is_finalizable): Same fix-up, for the finalizer wrapper symbol. * module.cc (read_module): Skip re-importing a symbol already visible via host association from the same module. gcc/testsuite/ChangeLog: PR fortran/126170 * gfortran.dg/lto/pr126170_0.f90: New test. * gfortran.dg/lto/pr126170_1.f90: New test.
