[all-commits] [llvm/llvm-project] 76ddb3: [flang][acc] Avoid assert for assumed-size arrays ...

khaki3 via All-commits all-commits at lists.llvm.org
Thu Jun 25 08:39:00 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76ddb39f1b18556b6de86c6cac0ebbb0ed6cb056
      https://github.com/llvm/llvm-project/commit/76ddb39f1b18556b6de86c6cac0ebbb0ed6cb056
  Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M flang/lib/Optimizer/OpenACC/Support/FIROpenACCTypeInterfaces.cpp
    M flang/test/Fir/OpenACC/openacc-mappable.fir

  Log Message:
  -----------
  [flang][acc] Avoid assert for assumed-size arrays without a descriptor (#205726)

Example:
```fortran
subroutine sub(a, n)
  real(8) :: a(n, *)
  integer :: n, i
  !$acc data no_create(a)
  !$acc parallel loop
  do i = 1, n
    a(1, i) = 0.0d0
  end do
  !$acc end data
end subroutine
```
An assumed-size dummy array (e.g. `real(8) :: a(n,*)`) has an unknown
trailing extent and is passed without a descriptor. When the OpenACC
implicit-data pass builds a data clause for such an array,
`generateSeqTyAccBounds` enters the unknown-shape branch but finds no
descriptor (`fir.box`) to recover bounds from, and hits:

assert(false && "array with unknown dimension expected to have
descriptor");

The premise is wrong: an assumed-size array legitimately has no
descriptor and no recoverable bounds.

Fix: return empty bounds instead of asserting. The caller only assigns
bounds when non-empty, so the array is mapped without bounds — the only
correct option when the extent is unknown, and sufficient for
presence-only clauses (`no_create`/`present`).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list