Skip to content

[flang][OpenMP][debug] Invalid debug info for variable size string in target region. #134991

Open
@abidh

Description

@abidh

For variable size arrays, flang generates an artificial variable in the debug info that holds the length. I noticed that variable inside the target region are using the artificial variable in the host for the length which is not working. As a result, the evaluation fails. The problem could be reproduced with the following program.

subroutine fn(b, c, d)
  integer c, d
  integer b(c, d)
  b = 2

  !$omp target map(tofrom:b)
    b(1, 1) = 2
  !$omp end target
end subroutine fn


program main
  integer a(10, 20)
  call fn(a, 10, 20)
  print *, a
end program

Run to line inside the target region and check the type of the b and you will see that it is not correct. I guess similar issue will exist with variable strings.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions