llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[Flang] fir.rebox verification failure when passing rank-2 actual to polymorphic assumed-size dummy

Open DanielCChen opened this issue 2 years ago • 5 comments

Consider the following code:

type base
  integer :: i
end type
class(base), pointer :: b1(:,:)
call sub(b1)
contains
subroutine sub(arg)
class(base) :: arg(1:*)
end
end

Flang currently issues

error: loc("t1.f":5:1): 'fir.rebox' op result type and shape operand ranks must match
error: verification of lowering to FIR failed

XLF, gfortran and ifort all compile this successfully.

DanielCChen avatar Feb 27 '24 18:02 DanielCChen

@llvm/issue-subscribers-bug

Author: Daniel Chen (DanielCChen)

Consider the following code: ``` type base integer :: i end type class(base), pointer :: b1(:,:) call sub(b1) contains subroutine sub(arg) class(base) :: arg(1:*) end end ```

Flang currently issues

error: loc("t1.f":5:1): 'fir.rebox' op result type and shape operand ranks must match
error: verification of lowering to FIR failed

XLF, gfortran and ifort all compile this successfully.

llvmbot avatar Feb 27 '24 18:02 llvmbot

Is it the same as https://github.com/llvm/llvm-project/issues/82640?

kkwli avatar Feb 27 '24 18:02 kkwli

Is it the same as #82640?

I think it is in the same category. The possible difference is that the test case in this issue should pass a descriptor while #82640 could just pass the the address of the object.

DanielCChen avatar Feb 27 '24 18:02 DanielCChen

@llvm/issue-subscribers-flang-ir

Author: Daniel Chen (DanielCChen)

Consider the following code: ``` type base integer :: i end type class(base), pointer :: b1(:,:) call sub(b1) contains subroutine sub(arg) class(base) :: arg(1:*) end end ```

Flang currently issues

error: loc("t1.f":5:1): 'fir.rebox' op result type and shape operand ranks must match
error: verification of lowering to FIR failed

XLF, gfortran and ifort all compile this successfully.

llvmbot avatar Feb 27 '24 18:02 llvmbot

The test cases associated with this issue are all fixed. Test case in issue #82640 still fails.

DanielCChen avatar Mar 25 '24 12:03 DanielCChen