Consider the following program.
module mod1
integer var1
integer var2
end module
module mod2
integer var1
integer var3
end module
PROGRAM test
use mod1, only: var2
use mod2, var4 => var3
!use mod3
var1 = 10
var4 = 20
var2 = 30
print *, var1
print *, var2
print *, var4
END PROGRAM test
When compiled and debugged in the GDB, here is what we get for var1 and var4 while stopped at first print line.
(gdb) p var1
Reference to "var1" is ambiguous, possibilities are: mod1::var1 and mod2::var1
(gdb) p var4
No symbol "var4" in current context.
(gdb) p var3
$1 = 20
The only and => were ignored by the debug information.
To fix this issue (and #160907), the information about module and the use statement have to be put in the FIR.