[LLVMbugs] [Bug 18001] New: Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/eschnett/src/llvm-3.4/lib/IR/Instructions.cpp, line 2352

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 19 21:26:18 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=18001

            Bug ID: 18001
           Summary: Assertion failed: (castIsValid(op, S, Ty) && "Invalid
                    cast!"), function Create, file
                    /Users/eschnett/src/llvm-3.4/lib/IR/Instructions.cpp,
                    line 2352
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: schnetter at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11569
  --> http://llvm.org/bugs/attachment.cgi?id=11569&action=edit
preprocessed source

I am using LLVM 3.4 (release branch). I call clang with
{{{
/Users/eschnett/llvm-3.4/bin/clang --target=x86_64-apple-macosx10.9.0
-march=core-avx-i -Xclang -ffake-address-space-map -emit-llvm -ffp-contract=off
-x cl -D__OPENCL_VERSION__=120 -fsigned-char -c -o atomics.cl.bc
../../../../pocl/lib/kernel/atomics.cl -include
/Users/eschnett/src/pocl-build/../pocl/include/_kernel.h
}}}

and receive the error
{{{
Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create,
file /Users/eschnett/src/llvm-3.4/lib/IR/Instructions.cpp, line 2352.
0  libLLVM-3.4svn.dylib     0x000000010f9ef6e8
llvm::sys::PrintStackTrace(__sFILE*) + 40
1  libLLVM-3.4svn.dylib     0x000000010f9efbf4 SignalHandler(int) + 564
2  libsystem_platform.dylib 0x00007fff8c55a5aa _sigtramp + 26
3  libsystem_platform.dylib 000000000000000000 _sigtramp + 1940544112
4  libLLVM-3.4svn.dylib     0x000000010f9ef9a6 abort + 22
5  libLLVM-3.4svn.dylib     0x000000010f9ef981 __assert_rtn + 81
6  libLLVM-3.4svn.dylib     0x000000010f33413d
llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*,
llvm::Twine const&, llvm::Instruction*) + 2333
7  clang                    0x000000010de9334c void
std::__1::vector<clang::serialization::ModuleFile*,
std::__1::allocator<clang::serialization::ModuleFile*>
>::__push_back_slow_path<clang::serialization::ModuleFile*
const>(clang::serialization::ModuleFile* const&) + 241884
8  clang                    0x000000010df01187
std::__1::vector<llvm::Constant*, std::__1::allocator<llvm::Constant*>
>::__append(unsigned long, llvm::Constant* const&) + 55847
9  clang                    0x000000010defa847
std::__1::vector<llvm::Constant*, std::__1::allocator<llvm::Constant*>
>::__append(unsigned long, llvm::Constant* const&) + 28903
10 clang                    0x000000010def3e20
std::__1::vector<llvm::Constant*, std::__1::allocator<llvm::Constant*>
>::__append(unsigned long, llvm::Constant* const&) + 1728
11 clang                    0x000000010de7226d void
std::__1::vector<clang::serialization::ModuleFile*,
std::__1::allocator<clang::serialization::ModuleFile*>
>::__push_back_slow_path<clang::serialization::ModuleFile*
const>(clang::serialization::ModuleFile* const&) + 106493
12 clang                    0x000000010de6e909 void
std::__1::vector<clang::serialization::ModuleFile*,
std::__1::allocator<clang::serialization::ModuleFile*>
>::__push_back_slow_path<clang::serialization::ModuleFile*
const>(clang::serialization::ModuleFile* const&) + 91801
13 clang                    0x000000010ded70d8 void
std::__1::vector<llvm::TrackingVH<llvm::MDNode>,
std::__1::allocator<llvm::TrackingVH<llvm::MDNode> >
>::__push_back_slow_path<llvm::TrackingVH<llvm::MDNode>
const>(llvm::TrackingVH<llvm::MDNode> const&) + 128264
14 clang                    0x000000010df008bd
std::__1::vector<llvm::Constant*, std::__1::allocator<llvm::Constant*>
>::__append(unsigned long, llvm::Constant* const&) + 53597
15 clang                    0x000000010defa91a
std::__1::vector<llvm::Constant*, std::__1::allocator<llvm::Constant*>
>::__append(unsigned long, llvm::Constant* const&) + 29114
16 clang                    0x000000010def3e20
std::__1::vector<llvm::Constant*, std::__1::allocator<llvm::Constant*>
>::__append(unsigned long, llvm::Constant* const&) + 1728
17 clang                    0x000000010df4f5f2 void
std::__1::vector<std::__1::pair<unsigned int, clang::CodeGen::CGBitFieldInfo
const*>, std::__1::allocator<std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> >
>::__push_back_slow_path<std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> const>(std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> const&) + 12290
18 clang                    0x000000010df4db29 void
std::__1::vector<std::__1::pair<unsigned int, clang::CodeGen::CGBitFieldInfo
const*>, std::__1::allocator<std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> >
>::__push_back_slow_path<std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> const>(std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> const&) + 5433
19 clang                    0x000000010df5342b void
std::__1::vector<std::__1::pair<unsigned int, clang::CodeGen::CGBitFieldInfo
const*>, std::__1::allocator<std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> >
>::__push_back_slow_path<std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> const>(std::__1::pair<unsigned int,
clang::CodeGen::CGBitFieldInfo const*> const&) + 28219
20 clang                    0x000000010df63613 void
llvm::DeleteContainerSeconds<llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > > >(llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > >&) + 24931
21 clang                    0x000000010df6e66c void
llvm::DeleteContainerSeconds<llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > > >(llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > >&) + 70076
22 clang                    0x000000010df6bed2 void
llvm::DeleteContainerSeconds<llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > > >(llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > >&) + 59938
23 clang                    0x000000010df6d948 void
llvm::DeleteContainerSeconds<llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > > >(llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > >&) + 66712
24 clang                    0x000000010df7008d void
llvm::DeleteContainerSeconds<llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > > >(llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > >&) + 76765
25 clang                    0x000000010df9e92f void
std::__1::vector<clang::CodeGen::VBTableInfo,
std::__1::allocator<clang::CodeGen::VBTableInfo>
>::__push_back_slow_path<clang::CodeGen::VBTableInfo
const>(clang::CodeGen::VBTableInfo const&) + 1599
26 clang                    0x000000010df5f7c4 void
llvm::DeleteContainerSeconds<llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > > >(llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > >&) + 8980
27 clang                    0x000000010dfb2fc3 void
std::__1::vector<clang::CodeGen::VBTableInfo,
std::__1::allocator<clang::CodeGen::VBTableInfo>
>::__push_back_slow_path<clang::CodeGen::VBTableInfo
const>(clang::CodeGen::VBTableInfo const&) + 85203
28 clang                    0x000000010df5e86a void
llvm::DeleteContainerSeconds<llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > > >(llvm::DenseMap<std::__1::pair<clang::CXXRecordDecl
const*, clang::CharUnits>, clang::VTableLayout const*,
llvm::DenseMapInfo<std::__1::pair<clang::CXXRecordDecl const*,
clang::CharUnits> > >&) + 5050
29 clang                    0x000000010dd01656
std::__1::__tree<std::__1::pair<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>,
std::__1::__map_value_compare<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit, std::__1::less<clang::edit::FileOffset>,
true>, std::__1::allocator<std::__1::pair<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit> >
>::destroy(std::__1::__tree_node<std::__1::pair<clang::edit::FileOffset,
clang::edit::EditedSource::FileEdit>, void*>*) + 5830
30 clang                    0x000000010dcdbd2d void
std::__1::vector<clang::CompilerInstance*,
std::__1::allocator<clang::CompilerInstance*>
>::__push_back_slow_path<clang::CompilerInstance*
const>(clang::CompilerInstance* const&) + 16205
31 clang                    0x000000010dca3a69
std::__1::enable_if<__is_forward_iterator<char const*>::value, void>::type
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >::__init<char const*>(char const*, char const*) +
4601
32 clang                    0x000000010dc9b9e3
33 clang                    0x000000010dc9fc2c void
std::__1::vector<llvm::SourceMgr::SrcBuffer,
std::__1::allocator<llvm::SourceMgr::SrcBuffer>
>::__push_back_slow_path<llvm::SourceMgr::SrcBuffer
const>(llvm::SourceMgr::SrcBuffer const&) + 1548
34 libdyld.dylib            0x00007fff8aa4e5fd start + 1
Stack dump:
0.    Program arguments: /Users/eschnett/llvm-3.4/bin/clang -cc1 -triple
x86_64-apple-macosx10.9.0 -emit-llvm-bc -disable-free -main-file-name
atomics.cl -mrelocation-model pic -pic-level 2 -mdisable-fp-elim
-ffp-contract=off -masm-verbose -munwind-tables -target-cpu core-avx-i
-target-linker-version 136 -coverage-file
/Users/eschnett/src/pocl-build/lib/kernel/host/atomics.cl.bc -resource-dir
/Users/eschnett/llvm-3.4/bin/../lib/clang/3.4 -include
/Users/eschnett/src/pocl-build/../pocl/include/_kernel.h -D
__OPENCL_VERSION__=120 -fdebug-compilation-dir
/Users/eschnett/src/pocl-build/lib/kernel/host -ferror-limit 19
-fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.9.0 -fencode-extended-block-signature
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp
-ffake-address-space-map -o atomics.cl.bc -x cl
../../../../pocl/lib/kernel/atomics.cl 
1.    ../../../../pocl/lib/kernel/atomics.cl:79:1: current parser token
'__attribute__'
2.    ../../../../pocl/lib/kernel/atomics.cl:73:3: LLVM IR generation of
declaration 'atomic_add'
3.    ../../../../pocl/lib/kernel/atomics.cl:73:3: Generating code for
declaration 'atomic_add'
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 (branches/release_34 195215)
Target: x86_64-apple-macosx10.9.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ 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/gl/zvl8d6415vsbkd50nnll95k40000gs/T/atomics-58b8d4.cl
clang: note: diagnostic msg:
/var/folders/gl/zvl8d6415vsbkd50nnll95k40000gs/T/atomics-58b8d4.sh
clang: note: diagnostic msg: 

********************
}}}

-- 
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/20131120/2b870c2c/attachment.html>


More information about the llvm-bugs mailing list