<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 frontend error compiling OpenCL c++ code"
href="https://bugs.llvm.org/show_bug.cgi?id=44974">44974</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang frontend error compiling 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>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>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=23150" name="attach_23150" title="Testcase">attachment 23150</a> <a href="attachment.cgi?id=23150&action=edit" title="Testcase">[details]</a></span>
Testcase
clang fails to compile the attached test case using the following command:
/home/qon/clang-build/install/bin/clang++ -cl-std=clc++ -x cl -emit-llvm
--target=spir64-unknown-unknown -O3 -cl-denorms-are-zero -cl-mad-enable
-cl-no-signed-zeros -ferror-limit=1000 -Xclang -finclude-default-header
-Dcl_clang_storage_class_specifiers -c testfail.cl -o test.bc
(using the latest commit 659500c0c9657fc6e8d2d184b507f4e4da99297e)
If I apply the minor modifications in testok.cl from the testcase, it works, so
I assume this is a bug in clang.
The error message I am getting is:
clang++: /home/qon/clang-build/llvm-project/llvm/lib/IR/Instructions.cpp:2751:
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.
Stack dump:
0. Program arguments: /home/qon/clang-build/install/bin/clang++
-cl-std=clc++ -x cl -emit-llvm --target=spir64-unknown-unknown -O3
-cl-denorms-are-zero -cl-mad-enable -cl-no-signed-zeros -ferror-limit=1000
-Xclang -finclude-default-header -Dcl_clang_storage_class_specifiers -c test.cl
-o test.bc
1. ../TPCClusterFinder/GPUTPCCFPeakFinder.cxx:153:8: current parser token
'void'
2. ../TPCClusterFinder/GPUTPCCFPeakFinder.cxx:91:33: LLVM IR generation of
declaration 'o2::gpu::GPUTPCCFPeakFinder::isPeak'
3. ../TPCClusterFinder/GPUTPCCFPeakFinder.cxx:91:33: Generating code for
declaration 'o2::gpu::GPUTPCCFPeakFinder::isPeak'
4. ../TPCClusterFinder/GPUTPCCFPeakFinder.cxx:121:6: LLVM IR generation of
compound statement ('{}')
#0 0x0000559d797f7771 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/qon/clang-build/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:22
#1 0x0000559d797f7804 PrintStackTraceSignalHandler(void*)
/home/qon/clang-build/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:1
#2 0x0000559d797f55ad llvm::sys::RunSignalHandlers()
/home/qon/clang-build/llvm-project/llvm/lib/Support/Signals.cpp:68:20
#3 0x0000559d797f6fb3 llvm::sys::CleanupOnSignal(unsigned long)
/home/qon/clang-build/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:31
#4 0x0000559d796feda4 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/qon/clang-build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:77:5
#5 0x0000559d796ff26e CrashRecoverySignalHandler(int)
/home/qon/clang-build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:383:1
#6 0x00007fe124ebe370 __restore_rt (/lib64/libpthread.so.0+0x15370)
#7 0x00007fe1248c71e1 raise (/lib64/libc.so.6+0x3a1e1)
#8 0x00007fe1248af55b abort (/lib64/libc.so.6+0x2255b)
#9 0x00007fe1248af42f (/lib64/libc.so.6+0x2242f)
#10 0x00007fe1248bead2 (/lib64/libc.so.6+0x31ad2)</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>