Crash/Assert on -loop-reduce

opt: /home/ryan/llvm/llvm_core/llvm-3.0/include/llvm/Support/Casting.h:194: typename cast_retty<Instruction, User *>::ret_type llvm::cast(llvm::User *const &): Assertion `isa(Val) && “cast() argument of incompatible type!”’ failed.
0 opt 0x000000000085cfef
1 opt 0x000000000085d509
2 libpthread.so.0 0x00007fdb30054c60
3 libc.so.6 0x00007fdb2f33fd05 gsignal + 53
4 libc.so.6 0x00007fdb2f343ab6 abort + 390
5 libc.so.6 0x00007fdb2f3387c5 __assert_fail + 245
6 opt 0x000000000051a9a6
7 opt 0x000000000051979e
8 opt 0x0000000000503863
9 opt 0x000000000050102e
10 opt 0x0000000000689184 llvm::LPPassManager::runOnFunction(llvm::Function&) + 836
11 opt 0x0000000000801f9f llvm::FPPassManager::runOnFunction(llvm::Function&) + 351
12 opt 0x000000000080221b llvm::FPPassManager::runOnModule(llvm::Module&) + 59
13 opt 0x000000000080236a llvm::MPPassManager::runOnModule(llvm::Module&) + 282
14 opt 0x0000000000802941 llvm::PassManagerImpl::run(llvm::Module&) + 337
15 opt 0x0000000000802e4a llvm::PassManager::run(llvm::Module&) + 10
16 opt 0x00000000004919d7 main + 5511
17 libc.so.6 0x00007fdb2f32aeff __libc_start_main + 255
18 opt 0x000000000048bc95
Stack dump:

If I don’t use the opt -loop-reduce then this code runs fine. I’m not really sure the issue.

It's hard to say what is happening without a testcase.

-Eli

Unfortunately, I cannot provide the exact code, but I will attempt to look for the reason and post a test case.

Unfortunately, I cannot provide the exact code, but I will attempt to look
for the reason and post a test case.

Okay... note that bugpoint is very good at reducing testcases which crash.

-Eli

Ok, I have attached the bugpoint-reduced-blocks.ll test case, just fyi. Thanks, I’m just curious at this point.

bugpoint-reduced-blocks.ll (1.97 KB)

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

-Eli