Issue 175611
Summary Missing !need$ comment for procedure scope use module statements
Labels
Assignees
Reporter ivan-pi
    When compiling the following modules with flang:

```
module t1
  integer :: a
end module

module t2
  use t1
  integer :: b
end module

module t3
  use t1
contains
   subroutine foo
      use t2, only: b
      print *, b
   end subroutine
end module
```

I noticed the `!need$` field for module `t2` is missing:

```
$ cat t3.mod
!mod$ v1 sum:5e7ce2aca48ec99b
!need$ c6e6786e4bfe25a5 n t1
module t3
use t1,only:a
contains
subroutine foo()
end
end
```

I expected their would also be a line:
```
!need$ <hash> n t2
```
but maybe that is not needed, since `t3` doesn't export any `t2` entity?


This was using,

```
$ flang --version
Homebrew flang version 21.1.8
Target: arm64-apple-darwin25.2.0
Thread model: posix
```

Are these hashes of any external use to the programmer? 


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to