[LLVMbugs] [Bug 4954] New: llvm-ld: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"'

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Sep 11 15:14:43 PDT 2009


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

           Summary: llvm-ld: Assertion `isa<X>(Val) && "cast<Ty>() argument
                    of incompatible type!"'
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicolas.geoffray at lip6.fr
                CC: llvmbugs at cs.uiuc.edu


The two following .bc files (produced by llvm-gcc on linux/x86_32) give an
assertion error when trying to llvm-ld them together in that particular order:
> llvm-ld first.bc second.bc

Doing llvm-ld second.bc first.bc works fine. The full backtrace is: 

llvm-ld: /home/varth/project/llvm-svn/llvm/include/llvm/Support/Casting.h:199:
typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&) [with X =
llvm::CompositeType, Y = const llvm::Type*]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.
0   llvm-ld   0x083eaa6a
1   llvm-ld   0x083eb6e3
2             0xb7f96420 __kernel_sigreturn + 0
3   libc.so.6 0xb7d1da01 abort + 257
4   libc.so.6 0xb7d1510e __assert_fail + 238
5   llvm-ld   0x08391526 llvm::ConstantFoldGetElementPtr(llvm::LLVMContext&,
llvm::Constant const*, bool, llvm::Constant* const*, unsigned int) + 470
6   llvm-ld   0x082e029f llvm::ConstantExpr::getGetElementPtrTy(llvm::Type
const*, llvm::Constant*, llvm::Value* const*, unsigned int) + 175
7   llvm-ld   0x083438b8 llvm::ConvertConstantType<llvm::ConstantExpr,
llvm::Type>::convert(llvm::ConstantExpr*, llvm::Type const*) + 408
8   llvm-ld   0x083484be llvm::ValueMap<llvm::ExprMapKeyType, llvm::Type,
llvm::ConstantExpr, false>::refineAbstractType(llvm::DerivedType const*,
llvm::Type const*) + 126
9   llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
10  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
11  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
12  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
13  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
14  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
15  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
16  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
17  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
18  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
19  llvm-ld   0x0836fdcc llvm::TypeMap<llvm::StructValType,
llvm::StructType>::RefineAbstractType(llvm::StructType*, llvm::DerivedType
const*, llvm::Type const*) + 2652
20  llvm-ld   0x0836b3e9 llvm::StructType::refineAbstractType(llvm::DerivedType
const*, llvm::Type const*) + 57
21  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
22  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
23  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
24  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
25  llvm-ld   0x083713ac llvm::TypeMap<llvm::FunctionValType,
llvm::FunctionType>::RefineAbstractType(llvm::FunctionType*, llvm::DerivedType
const*, llvm::Type const*) + 1644
26  llvm-ld   0x0836b4a9
llvm::FunctionType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
27  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
28  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
29  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
30  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
31  llvm-ld   0x0836fd77 llvm::TypeMap<llvm::StructValType,
llvm::StructType>::RefineAbstractType(llvm::StructType*, llvm::DerivedType
const*, llvm::Type const*) + 2567
32  llvm-ld   0x0836b3e9 llvm::StructType::refineAbstractType(llvm::DerivedType
const*, llvm::Type const*) + 57
33  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
34  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
35  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
36  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
37  llvm-ld   0x0836fdcc llvm::TypeMap<llvm::StructValType,
llvm::StructType>::RefineAbstractType(llvm::StructType*, llvm::DerivedType
const*, llvm::Type const*) + 2652
38  llvm-ld   0x0836b3e9 llvm::StructType::refineAbstractType(llvm::DerivedType
const*, llvm::Type const*) + 57
39  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
40  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
41  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
42  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
43  llvm-ld   0x0836fd77 llvm::TypeMap<llvm::StructValType,
llvm::StructType>::RefineAbstractType(llvm::StructType*, llvm::DerivedType
const*, llvm::Type const*) + 2567
44  llvm-ld   0x0836b3e9 llvm::StructType::refineAbstractType(llvm::DerivedType
const*, llvm::Type const*) + 57
45  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
46  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
47  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
48  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
49  llvm-ld   0x0836fdcc llvm::TypeMap<llvm::StructValType,
llvm::StructType>::RefineAbstractType(llvm::StructType*, llvm::DerivedType
const*, llvm::Type const*) + 2652
50  llvm-ld   0x0836b3e9 llvm::StructType::refineAbstractType(llvm::DerivedType
const*, llvm::Type const*) + 57
51  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
52  llvm-ld   0x0836fd77 llvm::TypeMap<llvm::StructValType,
llvm::StructType>::RefineAbstractType(llvm::StructType*, llvm::DerivedType
const*, llvm::Type const*) + 2567
53  llvm-ld   0x0836b3e9 llvm::StructType::refineAbstractType(llvm::DerivedType
const*, llvm::Type const*) + 57
54  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
55  llvm-ld   0x08371b7e llvm::TypeMap<llvm::PointerValType,
llvm::PointerType>::RefineAbstractType(llvm::PointerType*, llvm::DerivedType
const*, llvm::Type const*) + 1358
56  llvm-ld   0x0836b609
llvm::PointerType::refineAbstractType(llvm::DerivedType const*, llvm::Type
const*) + 57
57  llvm-ld   0x0836b173
llvm::DerivedType::unlockedRefineAbstractTypeTo(llvm::Type const*) + 291
58  llvm-ld   0x0836b4fe llvm::DerivedType::refineAbstractTypeTo(llvm::Type
const*) + 78
59  llvm-ld   0x080ef158
60  llvm-ld   0x080f71d6 llvm::Linker::LinkModules(llvm::Module*,
llvm::Module*, std::string*) + 694
61  llvm-ld   0x080edbd3 llvm::Linker::LinkInFile(llvm::sys::Path const&,
bool&) + 1299
62  llvm-ld   0x080eed5a
llvm::Linker::LinkInItems(std::vector<std::pair<std::string, bool>,
std::allocator<std::pair<std::string, bool> > > const&,
std::vector<std::pair<std::string, bool>, std::allocator<std::pair<std::string,
bool> > >&) + 282
63  llvm-ld   0x080cce5b main + 4027
64  libc.so.6 0xb7d07450 __libc_start_main + 224
65  llvm-ld   0x080c4b71 __gxx_personality_v0 + 293


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list