Skip to content

[Clang][OpenMP] Offloading entry for declare target variable is incorrect: the address is invalid #84942

@vzakhari

Description

@vzakhari

Reproducer:

struct ExecutionEnvironment {
  char *envp{nullptr};
  int listDirectedOutputLineLengthLimit{79};
};
#pragma omp declare target
ExecutionEnvironment env;
#pragma omp end declare target

clang++ dt.cpp -std=c++17 -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -fopenmp -fvisibility=hidden -fopenmp-cuda-mode --offload-arch=sm_70 -c:

error: Offloading entry for declare target variable env is incorrect: the address is invalid.

I wonder what limitation I am hitting here. In addition, it compiles well if I comment out any of the members of the struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions