<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58973>58973</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Compilation error in volatile statement(VOLATILE dummy argument)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 16.0.0(e0fb01e97b6b7d2fe66b17b36eeb98aa78c6e3bb)
```

Actual argument associated with `VOLATILE` dummy argument results in a compilation error.  
GNU's Fortran compiler is OK.  

The following are the test program, flang-new compilation results, and gfortran compilation results.  

snem0601_012_.f90
```fortran
  module mod
    contains
    subroutine sub(m6,error)
    integer,intent(inout) :: error

!    integer       :: m6
    integer,volatile :: m6

    if (any ((/m6/).ne.(/6/))) &
   & then
       error = 1
    end if
    end subroutine
  end module

  program fe1nvol12

    use mod
    integer :: error = 0

    call sub(6,error)

    if (error .ne. 0) then
      print *,'NG: snem0601_012'
    end if

    print *,'pass: snem0601_012'

  end program fe1nvol12
```

```
$ flang-new -flang-experimental-exec snem0601_012_.f90
error: Semantic errors in snem0601_012_.f90
./snem0601_012_.f90:21:14: error: Actual argument associated with VOLATILE dummy argument 'm6=' must be definable
      call sub(6,error)
               ^
./snem0601_012_.f90:21:14: '6_4' is not a variable
      call sub(6,error)
               ^
$
```

```
$ gfortran snem0601_012_.f90
$ ./a.out
 pass: snem0601_012
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVU2PnDgQ_TVwsQbZpptuDhx6Z9LRaqPksNlcRzYUtCNjt2wzs_Pvtwz9QZPpZFdahLApyvWeX5ULaZu3Kino6aZPCd19A-eVNcS2pNXCdA8GXkmS7wgrMprRhG-BtpIyKDeykJuGt1AUkm1kXgDIcivEZlsXkEuZ8HIKu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