[llvm-bugs] [Bug 44974] New: Clang frontend error compiling OpenCL c++ code
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Feb 20 07:59:59 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=44974
Bug ID: 44974
Summary: Clang frontend error compiling OpenCL c++ code
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: OpenCL
Assignee: unassignedclangbugs at nondot.org
Reporter: drohr at jwdt.org
CC: anastasia.stulova at arm.com, llvm-bugs at lists.llvm.org
Created attachment 23150
--> https://bugs.llvm.org/attachment.cgi?id=23150&action=edit
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)
--
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/20200220/1651de8a/attachment-0001.html>
More information about the llvm-bugs
mailing list