[LLVMbugs] [Bug 12627] New: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 22 17:14:34 PDT 2012


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

             Bug #: 12627
           Summary: Assertion `isa<X>(Val) && "cast<Ty>() argument of
                    incompatible type!"' failed.
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: chenyang at cs.utah.edu, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


[regehr at dyson reduce]$ clang -c -O3 -w small.c
clang:
/uusoc/exports/scratch/regehr/z/compiler-build/llvm-r155304/include/llvm/Support/Casting.h:194:
typename cast_retty<X, Y>::ret_type llvm::cast(const Y &) [X =
llvm::Instruction, Y = llvm::Value *]: Assertion `isa<X>(Val) && "cast<Ty>()
argument of incompatible type!"' failed.
0  clang           0x0000000001b5ea7f
1  clang           0x0000000001b5ef94
2  libpthread.so.0 0x00007ffff7bcf8f0
3  libc.so.6       0x00007ffff6ebea75 gsignal + 53
4  libc.so.6       0x00007ffff6ec25c0 abort + 384
5  libc.so.6       0x00007ffff6eb7941 __assert_fail + 241
6  clang           0x0000000001a003fd
llvm::SCEVExpander::replaceCongruentIVs(llvm::Loop*, llvm::DominatorTree
const*, llvm::SmallVectorImpl<llvm::WeakVH>&, llvm::TargetLowering const*) +
3613
7  clang           0x0000000001806379
8  clang           0x000000000198c269
llvm::LPPassManager::runOnFunction(llvm::Function&) + 841
9  clang           0x0000000001aff0ab
llvm::FPPassManager::runOnFunction(llvm::Function&) + 443
10 clang           0x0000000001926366
11 clang           0x0000000001aff583
llvm::MPPassManager::runOnModule(llvm::Module&) + 419
12 clang           0x0000000001affaf8 llvm::PassManagerImpl::run(llvm::Module&)
+ 408
13 clang           0x0000000001affc5a llvm::PassManager::run(llvm::Module&) +
10
14 clang           0x000000000076b7b0
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 4912
15 clang           0x00000000007696ba
16 clang           0x0000000000896885 clang::ParseAST(clang::Sema&, bool, bool)
+ 389
17 clang           0x0000000000768748 clang::CodeGenAction::ExecuteAction() +
184
18 clang           0x0000000000639b6d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973
19 clang           0x000000000062214b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3307
20 clang           0x0000000000616efb cc1_main(char const**, char const**, char
const*, void*) + 731
21 clang           0x000000000061e87a main + 3466
22 libc.so.6       0x00007ffff6ea9c4d __libc_start_main + 253
23 clang           0x0000000000616b59
Stack dump:
0.    Program arguments:
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r155304-install/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
small.c -mrelocation-model static -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.20.1
-momit-leaf-frame-pointer -coverage-file small.o -resource-dir
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r155304-install/bin/../lib/clang/3.2
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/local/include -internal-isystem
/uusoc/exports/scratch/regehr/z/compiler-install/llvm-gcc-r155304-install/bin/../lib/clang/3.2/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-w -fdebug-compilation-dir /home/regehr/z/reduce -ferror-limit 19
-fmessage-length 83 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option
-fcolor-diagnostics -o small.o -x c small.c 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.    Running pass 'Loop Pass Manager' on function '@fn10'
5.    Running pass 'Induction Variable Simplification' on basic block
'%for.body.us.i.preheader'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/small-UTsA7Y.i
clang: note: diagnostic msg: /tmp/small-UTsA7Y.sh
[regehr at dyson reduce]$ cat small.c
int a, b, c, d, e, f, g, h;
short i;
int fn1 ();
int fn2 ();
int
fn3 (int p1, int p2)
{
    return p1 > 0 || p2 && p1 ? p1 : p1 + 1;
}
void fn4 ();
void fn5 ();
int fn6 ();
static int fn7 ();
int fn8 ();
int fn9 (int, int);
void
fn10 ()
{
    fn7 ();
}
int
fn7 ()
{
    int j, k;
    j = -25;
    for (; j < -1; j = fn3 (j, 0))
    {
        d = a ? 0 : 1 % a;
        i = fn6 ();
        fn5 ();
        fn4 ();
        f = fn2 (e && c);
        g = fn1 ();
        h = fn8 (0);
        k = fn9 (0, c);
        if (j)
            b = 0;
    }
    b = k;
    return 0;
}
[regehr at dyson reduce]$ clang -v
clang version 3.2 (trunk 155304)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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