Fix ICE with coarrays and submodules [PR80235]
Exposing a variable in a module and referencing it in a submodule made the compiler ICE, because the external variable was not sorted into the correct module. In fact the module name was not set where the variable got built. gcc/fortran/ChangeLog: PR fortran/80235 * trans-decl.cc (gfc_build_qualified_array): Make sure the array is associated to the correct module and being marked as extern. gcc/testsuite/ChangeLog: * gfortran.dg/coarray/add_sources/submodule_1_sub.f90: New test. * gfortran.dg/coarray/submodule_1.f90: New test.
Showing
- gcc/fortran/trans-decl.cc 5 additions, 2 deletionsgcc/fortran/trans-decl.cc
- gcc/testsuite/gfortran.dg/coarray/add_sources/submodule_1_sub.f90 22 additions, 0 deletions...suite/gfortran.dg/coarray/add_sources/submodule_1_sub.f90
- gcc/testsuite/gfortran.dg/coarray/submodule_1.f90 29 additions, 0 deletionsgcc/testsuite/gfortran.dg/coarray/submodule_1.f90
Loading
Please register or sign in to comment