https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126170

--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Jerry DeLisle
<[email protected]>:

https://gcc.gnu.org/g:86717c5808dacd36b85e5d4cd3499c6fe96d2733

commit r16-9259-g86717c5808dacd36b85e5d4cd3499c6fe96d2733
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.

    (cherry picked from commit f935a7a9013d0748ba1f42dc532df3d278707bf6)

Reply via email to