Skip to content

[flang][OpenMP] copyprivate fails to lower pointers #95801

Closed
@luporl

Description

@luporl

Using pointers in copyprivate clauses results in an error when lowering.

subroutine test4
    implicit none
    integer, pointer :: p

    nullify (p)
    !$omp parallel private(p)
        allocate (p)
    !$omp single
        p = 42
    !$omp end single copyprivate(p)
    !$omp end parallel
end subroutine
error: loc("/app/example.f90":7:11): 'fir.convert' op invalid type conversion'i32' / '!fir.box<!fir.ptr<i32>>'
error: Lowering to LLVM IR failed
error: loc("/app/example.f90":7:11): cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface` registration for dialect for op: func.func
error: failed to create the LLVM module

Godbolt link: https://godbolt.org/z/j6Wh5scj1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions