<html>
<head>
<base href="http://llvm.org/bugs/" />
</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 --- - 3.4 release branch failed to compile a simple opencl kernel"
href="http://llvm.org/bugs/show_bug.cgi?id=18119">18119</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>3.4 release branch failed to compile a simple opencl kernel
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zhigang.gong@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The kernel's source code is as below:
typedef unsigned int uint;
struct xyz{
unsigned short b;
unsigned short e;
unsigned int o;
};
__kernel void
compiler_group_size4(__global struct xyz *src, __global unsigned int *dst,
unsigned int num, unsigned int c)
{
uint idx = (uint)get_global_id(0);
struct xyz td = src[idx];
for(unsigned x = td.b;x<=td.e;x++)
dst[td.o+x] = c;
}
The assertion is triggered as below:
gongzg@gongzg-ivb:~/git/fdo/build$ clang -cc1 -x cl -triple spir -emit-llvm -O1
compiler_group_size.cl
compiler_group_size.cl:10:20: warning: implicit declaration of function
'get_global_id' is invalid in C99
uint idx = (uint)get_global_id(0);
^
clang: /home/gongzg/git/llvm-3.2/llvm/lib/IR/Instructions.cpp:2352: static
llvm::CastInst *llvm::CastInst::Create(Instruction::CastOps, llvm::Value *,
llvm::Type *, const llvm::Twine &, llvm::Instruction *): Assertion
`castIsValid(op, S, Ty) && "Invalid cast!"' failed.
0 clang 0x0000000002196525 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1 clang 0x0000000002196963
2 libpthread.so.0 0x00007ffe5d57ecb0
3 libc.so.6 0x00007ffe5c3a0425 gsignal + 53
4 libc.so.6 0x00007ffe5c3a3b8b abort + 379
5 libc.so.6 0x00007ffe5c3990ee
6 libc.so.6 0x00007ffe5c399192
7 clang 0x0000000002119b94
8 clang 0x0000000001e05c77
9 clang 0x0000000001e05959
10 clang 0x0000000001e0972f
11 clang 0x0000000001e0144f
12 clang 0x0000000001e010ba
13 clang 0x0000000001e00473
14 clang 0x0000000001dfb5a7
15 clang 0x0000000001df91b9
16 clang 0x000000000212c6fa
llvm::FPPassManager::runOnFunction(llvm::Function&) + 362
17 clang 0x000000000212be5e
llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) + 238
18 clang 0x000000000212bcfd
llvm::legacy::FunctionPassManager::run(llvm::Function&) + 93
19 clang 0x000000000084cdf5
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 5845
20 clang 0x000000000084ab26
21 clang 0x00000000009b9a13 clang::ParseAST(clang::Sema&, bool, bool)
+ 515
22 clang 0x0000000000849da2 clang::CodeGenAction::ExecuteAction() +
514
23 clang 0x00000000006c07c0 clang::FrontendAction::Execute() + 112
24 clang 0x000000000069db7d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 925
25 clang 0x0000000000685100
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2880
26 clang 0x000000000067d37f cc1_main(char const**, char const**, char
const*, void*) + 687
27 clang 0x000000000068335e main + 9182
28 libc.so.6 0x00007ffe5c38b76d __libc_start_main + 237
29 clang 0x000000000067d009
Stack dump:
0. Program arguments: clang -cc1 -x cl -triple spir -emit-llvm -O1
compiler_group_size.cl
1. <eof> parser at end of file
2. Per-function optimization
3. Running pass 'SROA' on function '@compiler_group_size4'
Aborted (core dumped)</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>