Issue 124783
Summary [Flang] Failure on `fir.convert`
Labels flang:fir-hlfir
Assignees
Reporter DanielCChen
    Consider the following code:
```
module m
    type base
        integer(8), allocatable :: id
    end type

    type container
        type(base), allocatable :: b
    end type

    interface container
        procedure containerObjWithDefault
    end interface

    contains

 type(container) function containerObjWithDefault ()
        allocatable containerObjWithDefault

    end function
end module

program main
use m
    type(container), allocatable :: co1(:,:), co2(:,:)

    logical(8), allocatable :: l1(:,:)

    co2 = merge (container(), co1, l1)

end
```

Flang failed at the compile time `fir.covert`
```
error: loc("/home/cdchen/temp/t.f":28:5): 'fir.convert' op invalid type conversion'!fir.ref<!fir.type<_QMmTcontainer{b:!fir.box<!fir.heap<!fir.type<_QMmTbase{id:!fir.box<!fir.heap<i64>>}>>>}>>' / '!fir.box<!fir.heap<!fir.type<_QMmTcontainer{b:!fir.box<!fir.heap<!fir.type<_QMmTbase{id:!fir.box<!fir.heap<i64>>}>>>}>>>'
error: verification of lowering to FIR failed
```

Note: this is a reducer that would not execute as many variables are not defined, but it should compile successfully.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to