[llvm-bugs] [Bug 48896] New: Failure during C++ for OpenCL compilation

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 27 01:36:48 PST 2021


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

            Bug ID: 48896
           Summary: Failure during C++ for OpenCL compilation
           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 24425
  --> https://bugs.llvm.org/attachment.cgi?id=24425&action=edit
Testcase

The attached test case fails compilation with the following error:
clang++: /home/qon/tmp9/llvm-project/llvm/lib/IR/Instructions.cpp:2917: 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.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /home/qon/tmp9/llvm-project/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/GPUTPCCFCheckPadBaseline.cxx:131:8: current parser
token 'ChargePos'
2.      ../TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx:31:39: LLVM IR
generation of declaration 'o2::gpu::GPUTPCCFCheckPadBaseline::Thread'
3.      ../TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx:31:39: Generating code
for declaration 'o2::gpu::GPUTPCCFCheckPadBaseline::Thread'
4.      ../TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx:54:134: LLVM IR
generation of compound statement ('{}')
 #0 0x000055a3dc18d06c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/home/qon/tmp9/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:22
 #1 0x000055a3dc18d123 PrintStackTraceSignalHandler(void*)
/home/qon/tmp9/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
 #2 0x000055a3dc18adf9 llvm::sys::RunSignalHandlers()
/home/qon/tmp9/llvm-project/llvm/lib/Support/Signals.cpp:71:20
 #3 0x000055a3dc18c8c9 llvm::sys::CleanupOnSignal(unsigned long)
/home/qon/tmp9/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:31
 #4 0x000055a3dc0c386e (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/qon/tmp9/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:75:5
 #5 0x000055a3dc0c3d7b CrashRecoverySignalHandler(int)
/home/qon/tmp9/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:389:1
 #6 0x00007f22fb155810 __restore_rt (/lib64/libpthread.so.0+0x12810)
 #7 0x00007f22fab86b21 raise (/lib64/libc.so.6+0x38b21)
 #8 0x00007f22fab70536 abort (/lib64/libc.so.6+0x22536)
 #9 0x00007f22fab7041f (/lib64/libc.so.6+0x2241f)
#10 0x00007f22fab7f462 (/lib64/libc.so.6+0x31462)
#11 0x000055a3db6340e4 llvm::CastInst::Create(llvm::Instruction::CastOps,
llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::Instruction*)
/home/qon/tmp9/llvm-project/llvm/lib/IR/Instructions.cpp:2917:3
#12 0x000055a3d9379ffc
llvm::IRBuilderBase::CreateCast(llvm::Instruction::CastOps, llvm::Value*,
llvm::Type*, llvm::Twine const&)
/home/qon/tmp9/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2199:18
#13 0x000055a3d9379e26 llvm::IRBuilderBase::CreateBitCast(llvm::Value*,
llvm::Type*, llvm::Twine const&)
/home/qon/tmp9/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2159:3
#14 0x000055a3dc9e8d49
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, llvm::CallBase**, clang::SourceLocation)
/home/qon/tmp9/llvm-project/clang/lib/CodeGen/CGCall.cpp:4769:36
#15 0x000055a3dca8d73d
clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(clang::CXXMethodDecl
const*, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot,
llvm::Value*, llvm::Value*, clang::QualType, clang::CallExpr const*,
clang::CodeGen::CallArgList*)
/home/qon/tmp9/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp:90:59
#16 0x000055a3dca8fb64
clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr
const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool,
clang::NestedNameSpecifier*, bool, clang::Expr const*)
/home/qon/tmp9/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp:426:57
#17 0x000055a3dca8e0ac
clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(clang::CXXMemberCallExpr
const*, clang::CodeGen::ReturnValueSlot)
/home/qon/tmp9/llvm-project/clang/lib/CodeGen/CGExprCXX.cpp:204:66
#18 0x000055a3dca709f8
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot)
/home/qon/tmp9/llvm-project/clang/lib/CodeGen/CGExpr.cpp:4830:49
#19 0x000055a3dca8163d (anonymous
namespace)::AggExprEmitter::VisitCallExpr(clang::CallExpr
const*)::'lambda'(clang::CodeGen::ReturnValueSlot)::operator()(clang::CodeGen::ReturnValueSlot)
const /home/qon/tmp9/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:923:36
#20 0x000055a3dca8b213 clang::CodeGen::RValue
llvm::function_ref<clang::CodeGen::RValue
(clang::CodeGen::ReturnValueSlot)>::callback_fn<(anonymous
namespace)::AggExprEmitter::VisitCallExpr(clang::CallExpr
const*)::'lambda'(clang::CodeGen::ReturnValueSlot)>(long,
clang::CodeGen::ReturnValueSlot)
/home/qon/tmp9/llvm-project/llvm/include/llvm/ADT/STLExtras.h:185:52
#21 0x000055a3dca8c176 llvm::function_ref<clang::CodeGen::RValue
(clang::CodeGen::ReturnValueSlot)>::operator()(clang::CodeGen::ReturnValueSlot)
const /home/qon/tmp9/llvm-project/llvm/include/llvm/ADT/STLExtras.h:209:12
[...]
clang-13: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
dfb558b82d3f2ca228799b03d2be00b163d04ea5)
Target: spir64-unknown-unknown
Thread model: posix
InstalledDir: /home/qon/tmp9/llvm-project/install/bin
clang-13: note: diagnostic msg:

Reproducible with clang commit dfb558b82d3f2ca228799b03d2be00b163d04ea5
Command line: 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 testcase.cl -o test.bc

-- 
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/20210127/d873d43d/attachment.html>


More information about the llvm-bugs mailing list