Issue 129479
Summary [flang] flang issues error for transfer intrinsic
Labels flang
Assignees
Reporter shivaramaarao
    Consider the following program

program main
   integer, parameter :: n2 = 2
 integer, parameter :: n = 1
   integer :: in(n)
   real :: r_in2(n2)
 integer :: in2(n2)
   in = transfer(r_in2, in2)

end program

the above program compiles fine with gfortran and classic flang. However llvm flang issues following error

error: Semantic errors in xx.f90
./xx.f90:7:4: error: Dimension 1 of left-hand side has extent 1, but right-hand side has extent 2
     in = transfer(r_in2, in2)

>From the standard:

Return value:
The result has the same type as MOLD, with the bit level representation of SOURCE. If SIZE is present, the result is a one-dimensional array of length SIZE. If SIZE is absent but MOLD is an array (of any size or shape), the result is a one- dimensional array of the minimum length needed to contain the entirety of the bitwise representation of SOURCE. If SIZE is absent and MOLD is a scalar, the result is a scalar.

I am not sure if gfortran is wrong not to give error or llvm-flang is wrong issuing the error.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to