Skip to content

[flang][OpenMP] support arrays of atomic numbers #112908

@tblah

Description

@tblah

Support for atomic operations on scalar complex variables is being added in #92364.

flang also supports atomic operations which read a single element from an array. The openmp standard says that the lhs and rhs of the assignment must be "scalar variables of intrinsic type" (OpenMP 5.2 section 4.3.1.3). The result of the expression on the rhs must be scalar but the expression might involve arrays.

Currently (and after #92364) Flang will crash on an assertion on this code:

program atomic_array
  complex :: x(2)
  complex :: y
  !$omp parallel
    !$omp atomic read
      y = x(1)
  !$omp end parallel
end program

Reproduce with flang -fopenmp file.f90.

CC @NimishMishra

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions