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

    <tr>
        <th>Summary</th>
        <td>
            regresssion with Fortran kind REAL128 after version 19 ?
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          mfvalin
      </td>
    </tr>
</table>

<pre>
    the following code compiles without error with flang version 19 but fails to compile with versions 20 and 21

 ```
> cat test_real128.F90 
subroutine xreal128 (x, n)
    use,intrinsic :: iso_fortran_env, only: real128
    real(real128),dimension(*) :: x
 integer, intent(out) :: n

    n = x(1)/8
end subroutine xreal128
```
 > (module load llvm/19 ; flang-new -c test_real128.F90 ; flang-new --version ; )       
flang-new version 19.1.7 (https://github.com/llvm/llvm-project.git cd708029e0b2869e80abe31ddb175f7c35361f90)
Target: x86_64-unknown-linux-gnu

 > (module load llvm/20 ; flang-new -c test_real128.F90 ; flang-new --version ; )
error: Semantic errors in test_real128.F90
./test_real128.F90:3:5: error: REAL(KIND=-1) is not a supported type
      real(real128),dimension(*) :: x
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flang version 20.1.0-rc1 (https://github.com/llvm/llvm-project.git 0cca13f758a8bda75eab45ad4bf896bb83921ec9)
Target: x86_64-unknown-linux-gnu

 > (module load llvm/21 ; flang-new -c test_real128.F90 ; flang-new --version ; )
error: Semantic errors in test_real128.F90
./test_real128.F90:3:5: error: REAL(KIND=-1) is not a supported type
      real(real128),dimension(*) :: x
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flang version 21.0.0git (https://github.com/llvm/llvm-project.git 077e0c134a31cc16c432ce685458b1de80bfbf84)
Target: x86_64-unknown-linux-gnu

this error makes it impossible to build openmpi or mpich

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