[llvm-bugs] [Bug 41826] New: libomptarget: Crash for global symbols with name "times"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 10 01:07:30 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41826

            Bug ID: 41826
           Summary: libomptarget: Crash for global symbols with name
                    "times"
           Product: OpenMP
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: Cramer at itc.rwth-aachen.de
                CC: llvm-bugs at lists.llvm.org

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
#endif

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

int main(void) {

  #pragma omp target device(0)
  {
    #if BUG
    times[8]  = 42;
    #else
    times2[8] = 42;
    #endif
  }
  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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190510/c3ccb247/attachment.html>


More information about the llvm-bugs mailing list