<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 crash for OpenCL local void** arithmetic"
   href="https://bugs.llvm.org/show_bug.cgi?id=35540">35540</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang crash for OpenCL local void** arithmetic
          </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>enhancement
          </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>pjcoup@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On this module:
-bash-4.1$ cat t.cl 
void st(int, local void *);

void process(local void ** wr) {
  st(5, wr[0] + 2);
}

clang asserts with:
clang -target spir -S -emit-llvm t.cl
clang-6.0: /SCRATCH/petecoup/llvm-monorepo/llvm/lib/IR/Instructions.cpp:2565:
static llvm::CastInst* llvm::CastInst::Create(llvm::Instruction::CastOps,
llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion
`castIsValid(op, S, Ty) && "Invalid cast!"' failed.
#0 0x00000000020a139a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/SCRATCH/petecoup/build_monorepo/bin/clang-6.0+0x20a139a)
#1 0x000000000209f23e llvm::sys::RunSignalHandlers()
(/SCRATCH/petecoup/build_monorepo/bin/clang-6.0+0x209f23e)
#2 0x000000000209f3a2 SignalHandler(int)
(/SCRATCH/petecoup/build_monorepo/bin/clang-6.0+0x209f3a2)
#3 0x00007ffff7bcf710 __restore_rt (/lib64/libpthread.so.0+0xf710)
#4 0x00007ffff6807625 __GI_raise (/lib64/libc.so.6+0x32625)
#5 0x00007ffff6808e05 __GI_abort (/lib64/libc.so.6+0x33e05)
#6 0x00007ffff680074e __assert_fail_base (/lib64/libc.so.6+0x2b74e)
#7 0x00007ffff6800810 __GI___assert_perror_fail (/lib64/libc.so.6+0x2b810)
#8 0x0000000001ba8e57
(/SCRATCH/petecoup/build_monorepo/bin/clang-6.0+0x1ba8e57)
#9 0x000000000228ae56 llvm::IRBuilder<llvm::ConstantFolder,
clang::CodeGen::CGBuilderInserter>::CreateCast(llvm::Instruction::CastOps,
llvm::Value*, llvm::Type*, llvm::Twine const&)
(/SCRATCH/petecoup/build_monorepo/bin/clang-6.0+0x228ae56)</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>