Skip to content

v1: two host variables sharing a local name with different standard names will compile but clobber silently #774

Closed

Description

@jimmielin

Description

This is from Claude when investigating whether #772 applies to capgen-v1.

When looking at host vars imported by use ... only:, Claude found that two host variables sharing a local name with different standard names

v1 accepts this silently (exit 0, no warning) and emits a cap where the control-arg dummy shadows the use-associated host variable:

use test_host_mod, only: ncols, nthreads   ! host var, std name test_host_thread_count
...
  subroutine grp_one_run(..., nthreads, ...)
    integer, intent(in) :: nthreads         ! control arg, std name number_of_threads
    ...
    call thr_use_run(ncol=..., ni=nthreads, ...)   ! binds to the DUMMY

The scheme asked for test_host_thread_count but receives the framework's thread count. It compiles clean and runs with wrong data. I confirmed the Fortran semantics with a standalone test (dummy value 7 wins over host parameter 999), so this is a silent wrong-value bug, not a compile error.

Steps to Reproduce

commit ed284a8a4a6507f8c684839dbe2a2e2770b3a09d (HEAD, upstream/feature/capgen-v1)

see above.

Additional Context

Output

Activity

  1. added
    bug
    on Jul 30, 2026
  2. self-assigned this
    on Jul 31, 2026
  3. climbfuji commented on Jul 31, 2026

    @climbfuji
    Collaborator

    Thanks for the check. I assigned this to myself, will work on it after my PTO

  4. climbfuji commented on Sep 8, 2026

    @climbfuji
    Collaborator

    Closed via #776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions