<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - compiler fatal error with offload"
   href="https://bugs.llvm.org/show_bug.cgi?id=38702">38702</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>compiler fatal error with offload
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>xw111luoye@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When compiling miniQMC offload branch.
<a href="https://github.com/QMCPACK/miniqmc/tree/OMP_offload">https://github.com/QMCPACK/miniqmc/tree/OMP_offload</a>
mkdir build_clang_offload; cd build_clang_offload
cmake -DCMAKE_CXX_COMPILER="clang++" -DQMC_MPI=0 -DENABLE_OFFLOAD=1 ..
make
I got the following error. This cpp is pure regular CPU code.
My workaround is just removing -fopenmp-targets=nvptx64-nvidia-cuda
But this is a bug of compiler and needs a fix.

[ 23%] Building CXX object
src/CMakeFiles/qmcutil.dir/Utilities/tinyxml/tinyxml2.cpp.o
cd /sandbox/opt/miniqmc/build_clang_offload/src &&
/sandbox/opt/llvm-clang/clang-offload/bin/clang++  -DADD_ -DH5_USE_16_API
-DHAVE_CONFIG_H -DINLINE_ALL=inline -DUSE_REAL_STRUCT_FACTOR
-Drestrict=__restrict__ -I/sandbox/opt/miniqmc/src
-I/sandbox/opt/miniqmc/build_clang_offload/src 
--gcc-toolchain=/soft/apps/packages/gcc/gcc-6.2.0 -fopenmp
-fopenmp-targets=nvptx64-nvidia-cuda -fomit-frame-pointer -fstrict-aliasing
-D__forceinline=inline -Wno-deprecated -Wno-unused-value
-Wno-undefined-var-template -O3 -DNDEBUG -ffast-math   -std=c++11 -o
CMakeFiles/qmcutil.dir/Utilities/tinyxml/tinyxml2.cpp.o -c
/sandbox/opt/miniqmc/src/Utilities/tinyxml/tinyxml2.cpp
fatal error: error in backend: Cannot select: 0x6474890: ch = vaend 0x6474828,
0x63ff9e8, SrcValue:ch<0x6272d08>
  0x63ff9e8: i64,ch = CopyFromReg 0x5ca19f8, Register:i64 %11
    0x6410920: i64 = Register %11
In function: _ZN8tinyxml211XMLDocument8SetErrorENS_8XMLErrorEiPKcz
clang-8: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 8.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
1bdec838c54117d9befe6dfcd3336a0ba5de9e0d)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
7b5db9830a20edbd0ff0e71e91acb654684f4003)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /sandbox/opt/llvm-clang/clang-offload/bin
clang-8: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang-8: note: diagnostic msg: Error generating preprocessed source(s).
make[2]: *** [src/CMakeFiles/qmcutil.dir/Utilities/tinyxml/tinyxml2.cpp.o]
Error 70
make[2]: Leaving directory `/sandbox/opt/miniqmc/build_clang_offload'
make[1]: *** [src/CMakeFiles/qmcutil.dir/all] Error 2
make[1]: Leaving directory `/sandbox/opt/miniqmc/build_clang_offload'
make: *** [all] Error 2</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>