Bug ID: 41826
           Summary: libomptarget: Crash for global symbols with name
           Product: OpenMP
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime Library

For OpenMP codes using target device offloading global arrays must not be named
"times", because this causes a crash. I guess the there is some kind of nameing
conflict. Here is a reproducer:

#ifndef BUG
#define BUG 1

#pragma omp declare target
#if BUG
int  times[10];
int times2[10];
#pragma omp end declare target

int main(void) {

  #pragma omp target device(0)
    #if BUG
    times[8]  = 42;
    times2[8] = 42;
  return 0;

If I rename the array from "times" to "times2" it works as expected. I compiled
with "clang -fopenmp -fopenmp-targets=x86_64-unknown-linux-gnu  main.c -DBUG=1
-o bug".

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to