Hi,
In a routine that does use some_module, only: var, the plain name can’t be evaluated in the debugger (“Undefined variable”). The module-qualified name works: some_module::var. ifort resolved the plain name.
Environment
- ifx 2026.1.1 (Intel(R) Fortran 26.0-1156 / DPC++/C++ Compiler 2026.1.1 20260724)
- Visual Studio 2026 Professional, Windows 11 x64, Debug build,
/Od /Z7 /debug:full, linked with/debug - Intel Fortran Expression Evaluator 2.0.0 is installed.
Reproducer: three files
m_vars.f90
module gtm
implicit none
integer :: ntank = 0
real, allocatable :: tankgiip(:)
end module gtm
hdf_demo.f90
module hdf_demo
contains
subroutine settank(it)
use gtm, only: tankgiip, ntank
implicit none
integer, intent(in) :: it
real :: x
x = tankgiip(it) + real(ntank) ! <- breakpoint here, then evaluate: tankgiip, ntank
tankgiip(it) = x
end subroutine settank
end module hdf_demo
main.f90
program demo
use gtm, only: tankgiip, ntank
use hdf_demo, only: settank
implicit none
ntank = 7
allocate(tankgiip(ntank)); tankgiip = 1.0
call settank(3)
print *, tankgiip(1)
end program demo
Build
ifx /Od /Z7 /debug:full m_vars.f90 hdf_demo.f90 main.f90 /link /debug
Expected: tankgiip and ntank can be evaluated at the breakpoint.
Actual: tankgiip gives Undefined variable, while gtm::tankgiip works.
What I found in the debug info. The object file for hdf_demo.f90 has no S_LDATA32 record for tankgiip or ntank in settank.
The records appear if any routine in the same file imports the module with no ONLY list. Adding this to hdf_demo.f90, never called, is enough:
subroutine never_called()
use gtm ! whole-module USE
implicit none
end subroutine never_called
Then settank gets S_LDATA32 NTANK and S_LDATA32 TANKGIIP.
I couldn’t find any compile options which changes this.
Thanks