<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 - Clang internal error during compilation of OpenCL C++ code"
   href="https://bugs.llvm.org/show_bug.cgi?id=40778">40778</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang internal error during compilation of OpenCL C++ code
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>OpenCL
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>drohr@jwdt.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anastasia.stulova@arm.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21492" name="attach_21492" title="Clang asked to attach these files to the bug report">attachment 21492</a> <a href="attachment.cgi?id=21492&action=edit" title="Clang asked to attach these files to the bug report">[details]</a></span>
Clang asked to attach these files to the bug report

Compiling the code in the attachment, I get a clang-internal error:

FYI: after the discussion in bug report 40707, I replaced all global / local /
constant / private in the libclc headers with __global, __local, ...

Below is the clang error message:

Base/opencl/AliGPUReconstructionOCL.cl:64:15: error: unsupported initializer
for address space
__kernel void AliGPUTPCProcess_25AliGPUTPCNeighboursFinder0(__global char*
gpu_mem, __global AliGPUConstantMem* pConstant, int iSlice)
              ^
Base/opencl/AliGPUReconstructionOCL.cl:64:15: error: unsupported initializer
for address space
fatal error: error in backend: Cannot select: 0x55fb301a4f80: i32 =
GlobalAddress<{ i32, i32, i32, float, float, float, float, i32, i32, i32, [256
x [6 x <2 x float>]], [256 x [6 x i32]], %class.AliGPUTPCRow,
%class.AliGPUTPCRow, %class.AliGPUTPCRow } addrspace(3)*
     
@_ZZ45AliGPUTPCProcess_25AliGPUTPCNeighboursFinder0PU3AS1cPU3AS117AliGPUConstantMemiE4smem>
0
In function:
_Z45AliGPUTPCProcess_25AliGPUTPCNeighboursFinder0PU3AS1cPU3AS117AliGPUConstantMemi
clang-9: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0 (/var/tmp/portage/sys-devel/clang-9999/work/x/y/clang-9999
b492883ea31e2046d5725126318911465bc1374f)
Target: amdgcn-amd-amdhsa
Thread model: posix
InstalledDir: /usr/lib/llvm/9/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to  and include the
crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/test-7df905.cl
clang-9: note: diagnostic msg: /tmp/test-7df905.sh
clang-9: note: diagnostic msg: 

********************</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>