<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 --- - clang crashes on array assignment with cast in CUDA source file"
   href="http://llvm.org/bugs/show_bug.cgi?id=17965">17965</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes on array assignment with cast in CUDA source file
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jeroen.ketema@yahoo.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>Created <span class=""><a href="attachment.cgi?id=11557" name="attach_11557" title="Processed source file">attachment 11557</a> <a href="attachment.cgi?id=11557&action=edit" title="Processed source file">[details]</a></span>
Processed source file

Assertion failed: (CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr
cast!"), function getCast, file
/Users/jketema/gpuverify34/llvm/lib/IR/Constants.cpp, line 1448.
0  clang             0x000000010c66a2ae llvm::sys::PrintStackTrace(__sFILE*) +
46
1  clang             0x000000010c66a5bb PrintStackTraceSignalHandler(void*) +
27
2  clang             0x000000010c66a938 SignalHandler(int) + 408
3  libsystem_c.dylib 0x00007fff8b4d790a _sigtramp + 26
4  libsystem_c.dylib 0x00007fff568a06b8 _sigtramp + 3409743304
5  clang             0x000000010c66a5eb raise + 27
6  clang             0x000000010c66a6a2 abort + 18
7  clang             0x000000010c66a681 __assert_rtn + 129
8  clang             0x000000010c464088 llvm::ConstantExpr::getCast(unsigned
int, llvm::Constant*, llvm::Type*) + 328
9  clang             0x000000010afda647
llvm::ConstantFolder::CreateCast(llvm::Instruction::CastOps, llvm::Constant*,
llvm::Type*) const + 39
10 clang             0x000000010afda59b llvm::IRBuilder<true,
llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true>
<span class="quote">>::CreateCast(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*,</span >
llvm::Twine const&) + 123
11 clang             0x000000010bef8104 llvm::IRBuilder<true,
llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true>
<span class="quote">>::CreateBitCast(llvm::Value*, llvm::Type*, llvm::Twine const&) + 52</span >
12 clang             0x0000000109780ad6 (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) + 2278
13 clang             0x000000010977bc98 clang::StmtVisitorBase<clang::make_ptr,
(anonymous namespace)::ScalarExprEmitter,
llvm::Value*>::VisitImplicitCastExpr(clang::ImplicitCastExpr*) + 40
14 clang             0x00000001097776e0 clang::StmtVisitorBase<clang::make_ptr,
(anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
3120
15 clang             0x000000010976cfe8 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) + 40
16 clang             0x0000000109780413 (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr*) + 547
17 clang             0x00000001097817db (anonymous
namespace)::ScalarExprEmitter::VisitExplicitCastExpr(clang::ExplicitCastExpr*)
+ 123
18 clang             0x000000010977bb48 clang::StmtVisitorBase<clang::make_ptr,
(anonymous namespace)::ScalarExprEmitter,
llvm::Value*>::VisitCStyleCastExpr(clang::CStyleCastExpr*) + 40
19 clang             0x000000010977761c clang::StmtVisitorBase<clang::make_ptr,
(anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
2924
20 clang             0x000000010976cfe8 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) + 40
21 clang             0x000000010977e940 (anonymous
namespace)::ScalarExprEmitter::VisitParenExpr(clang::ParenExpr*) + 48
22 clang             0x0000000109777b78 clang::StmtVisitorBase<clang::make_ptr,
(anonymous namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) +
4296
23 clang             0x000000010976cfe8 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*) + 40
24 clang             0x000000010976cf50
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 224
25 clang             0x000000010972d421
clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(clang::ArraySubscriptExpr
const*, bool) + 2865
26 clang             0x00000001097263ee
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 1134
27 clang             0x000000010972c7ff
clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*,
clang::CodeGen::CodeGenFunction::TypeCheckKind) + 207
28 clang             0x000000010972dc3d
clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(clang::BinaryOperator
const*) + 733
29 clang             0x0000000109726061
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 225
30 clang             0x0000000109725d5e
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 158
31 clang             0x00000001097fd860
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 528
32 clang             0x000000010980663b
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 139
33 clang             0x0000000109805c4f
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 239
34 clang             0x00000001097fde6b
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 299
35 clang             0x00000001097fd6cd
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 125
36 clang             0x00000001097ff1bf
clang::CodeGen::CodeGenFunction::EmitForStmt(clang::ForStmt const&) + 1183
37 clang             0x00000001097fd990
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 832
38 clang             0x000000010980663b
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 139
39 clang             0x00000001098232dc
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) + 108
40 clang             0x000000010982385b
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1371
41 clang             0x0000000109835aae
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 894
42 clang             0x000000010983190f
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 511
43 clang             0x00000001098349c4
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 948
44 clang             0x00000001098372d4
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 292
45 clang             0x00000001098aa970 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 128
46 clang             0x000000010981de45
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 181
47 clang             0x00000001098c6dc7 clang::ParseAST(clang::Sema&, bool,
bool) + 631
48 clang             0x000000010945736a
clang::ASTFrontendAction::ExecuteAction() + 522
49 clang             0x000000010981d3a2 clang::CodeGenAction::ExecuteAction() +
1266
50 clang             0x0000000109456dcf clang::FrontendAction::Execute() + 191
51 clang             0x000000010940dc47
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 983
52 clang             0x0000000109371a76
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1942
53 clang             0x00000001093599c1 cc1_main(char const**, char const**,
char const*, void*) + 929
54 clang             0x00000001093680d0 main + 880
55 libdyld.dylib     0x00007fff8cda67e1 start + 0
Stack dump:
0.    Program arguments:
/Users/jketema/gpuverify34/llvm-build/Debug+Asserts/bin/clang -cc1 -triple
nvptx--bugle -emit-llvm-bc -disable-free -main-file-name kernel.cu
-mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases
-target-linker-version 224.1 -g -dwarf-column-info -coverage-file
/Users/jketema/gpuverify34/gpuverify/testsuite/CUDA/pointertests/cast/kernel.bc
-resource-dir
/Users/jketema/gpuverify34/llvm-build/Debug+Asserts/bin/../lib/clang/3.4
-include cuda.h -D __CUDA_ARCH__ -D __1D_THREAD_BLOCK -D __1D_GRID -D
__BLOCK_DIM_0=32 -D __GRID_DIM_0=64 -I
/Users/jketema/gpuverify34/bugle/include-blang -I
/Users/jketema/gpuverify34/libclc-install/include -Wall -fdeprecated-macro
-fno-dwarf-directory-asm -fdebug-compilation-dir
/Users/jketema/gpuverify34/gpuverify/testsuite/CUDA/pointertests/cast
-ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp
-fcuda-is-device -o
/Users/jketema/gpuverify34/gpuverify/testsuite/CUDA/pointertests/cast/kernel.bc
-x cuda
/Users/jketema/gpuverify34/gpuverify/testsuite/CUDA/pointertests/cast/kernel.cu 
1.    <eof> parser at end of file
2.   
/Users/jketema/gpuverify34/gpuverify/testsuite/CUDA/pointertests/cast/kernel.cu:11:17:
LLVM IR generation of declaration 'foo'
3.   
/Users/jketema/gpuverify34/gpuverify/testsuite/CUDA/pointertests/cast/kernel.cu:11:17:
Generating code for declaration 'foo'
4.   
/Users/jketema/gpuverify34/gpuverify/testsuite/CUDA/pointertests/cast/kernel.cu:14:40:
LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (trunk)
Target: nvptx--bugle
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg:
/var/folders/hv/mkcb881x14334ks9q1smdylc0000gp/T/kernel-ecdf6b.cpp
clang: note: diagnostic msg:
/var/folders/hv/mkcb881x14334ks9q1smdylc0000gp/T/kernel-ecdf6b.sh
clang: note: diagnostic msg: 

********************</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>