Issue |
120042
|
Summary |
[Flang] Compilation error when two arguments of transfer intrinsic function have different kind type parameters
|
Labels |
flang:frontend
|
Assignees |
|
Reporter |
ohno-fj
|
```
Version of flang : 20.0.0(2b129dacdde667137b5012d52f1d96e0ab26c749)/AArch64
```
When building [bigdft-chess Version 1.9.5](https://gitlab.com/l_sim/bigdft-suite/-/archive/1.9.5/bigdft-suite-1.9.5.tar.gz), a compilation error occurs.
When two arguments (`source` and `mold`) of `transfer` intrinsic function have different `kind type parameters`, a compilation error occurs.
Even if the `types` are the same or different, if the `kind type parameters` are the same (for example, kind=4 and kind=4), a compilation terminates normally, and if they are different (for example, kind=4 and kind=8), a compilation error occurs.
The following are the test program, Flang, Gfortran and ifx compilation/execution result.
test_2.f90:
```fortran
program main
integer(4), dimension(5) :: int_array
real(8), dimension(5) :: real_array
int_array = (/ 1, 2, 3, 4, 5 /)
real_array = transfer(int_array, real_array)
write(6,*) "real_array = ", real_array
end program main
```
```
$ flang test_2.f90
error: Semantic errors in test_2.f90
./test_2.f90:5:3: error: Dimension 1 of left-hand side has extent 5, but right-hand side has extent 3
real_array = transfer(int_array, real_array)
^^^^^^^^^^
$
```
```
$ gfortran test_2.f90; ./a.out
real_array = 4.2439915824246103E-314 8.4879831653432862E-314 2.4703282292062327E-323 3.4767205879998127E-310 3.4767205879660186E-310
$
```
```
$ ifx test_2.f90; ./a.out
real_array = 4.243991582424610E-314 8.487983165343286E-314
2.470328229206233E-323 0.000000000000000E+000 0.000000000000000E+000
$
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs