Issue 136406
Summary [Flang][OpenACC] Assertion `mlir::isa<mlir::acc::PointerLikeType>(baseAddr.getType()) && "expected pointer-like"' failed.
Labels mlir, flang
Assignees
Reporter k-arrows
    Crash itself is reproducible on godbolt. The reproducer here is reduced from https://github.com/gcc-mirror/gcc/blob/master/libgomp/testsuite/libgomp.oacc-fortran/privatized-ref-2.f90.
See https://godbolt.org/z/cxzK8Y3vs
```f90
program main
  implicit none (type, external)
  character(len=:), allocatable :: my_str

  my_str = "1234567890"
  call foo_str(my_str)
  deallocate (my_str)
contains
 subroutine foo_str(str)
    integer :: i
    character(len=*) :: str

 !$acc parallel copyout(str)
    str = "abcdefghij"
    !$acc end parallel
  end
end
```

With assertion-enabled flang, the reproducer hits the following assertion:
```txt
/path_to_project/llvm-project/flang/lib/Lower/OpenACC.cpp:164: Op createDataEntryOp(fir::FirOpBuilder &, mlir::Location, mlir::Value, std::stringstream &, mlir::SmallVector<mlir::Value>, bool, bool, mlir::acc::DataClause, mlir::Type, llvm::ArrayRef<mlir::Value>, llvm::ArrayRef<mlir::Attribute>, llvm::ArrayRef<mlir::Attribute>, bool, mlir::Value) [Op = mlir::acc::CreateOp]: Assertion `mlir::isa<mlir::acc::PointerLikeType>(baseAddr.getType()) && "expected pointer-like"' failed.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to