Skip to content

[Clang][OpenMP] Compilation error on omp threadprivate when -fopenmp-targets=amdgcn-amd-amdhsa #86791

@fel-cab

Description

@fel-cab

The following code:

int GlobalVar;
#pragma omp threadprivate(GlobalVar)
int main() {
    GlobalVar = 1;
}

https://godbolt.org/z/nzeK5b51j

On the system, the error of the compiler is:

Function return type does not match operand type of return inst!
  ret ptr addrspace(1) %1
 ptrfatal error: error in backend: Broken module found, compilation aborted!
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)

minTest_test_task_ThrdPrivate.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.clang:openmpOpenMP related changes to ClangcrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions