Issue 143569
Summary [flang] Unlimited pointer assignment within FORALL caused FIR verification failure
Labels flang:fir-hlfir
Assignees
Reporter DanielCChen
    Consider the following code:
```
module m
    type base
        integer*4 :: id = 0
    end type

    type, extends(base) :: child
        character*15 :: name = ''
    end type

    type (child), target, save :: c1_m(10)
end module

module m1
use m
    type baseContainer
        class (base), pointer :: data ="" null()
    end type

    type anyContainer
 class (*), pointer :: data ="" null()
        !character*1, pointer :: data ="" null()    ! workaround 1
    end type

end module

program fpAssgn025a
use m1
    type (anyContainer) :: co_a1(10)

    character*1, target :: ch1(10)

    class (child), target, allocatable :: c1(:)

 allocate (c1(10))

    forall (i=1:10)
    !do i = 1, 10 ! wordaround 2
        co_a1(i)%data ="" ch1(i)
    !end do
    end forall

end
```

Flang has
```
error: loc("t.f":38:9): 'fir.embox' op LEN parameters require CHARACTER or derived type
error: verification of lowering to FIR failed
```

If I apply either workaround marked in the code (1. don't use unlimited poly; 2. use do loop instead of forall), it compiles successfully. 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to