<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 - Failure during C++ for OpenCL compilation"
   href="https://bugs.llvm.org/show_bug.cgi?id=48896">48896</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Failure during C++ for OpenCL compilation
          </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=24425" name="attach_24425" title="Testcase">attachment 24425</a> <a href="attachment.cgi?id=24425&action=edit" title="Testcase">[details]</a></span>
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 <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
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</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>