[llvm-bugs] [Bug 35540] New: Clang crash for OpenCL local void** arithmetic

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 5 15:01:21 PST 2017


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

            Bug ID: 35540
           Summary: Clang crash for OpenCL local void** arithmetic
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OpenCL
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pjcoup at gmail.com
                CC: llvm-bugs at lists.llvm.org

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)

-- 
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/20171205/bd71faf0/attachment.html>


More information about the llvm-bugs mailing list