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<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.<br>
0 opt 0x000000000085cfef<br>1 opt 0x000000000085d509<br>2 libpthread.so.0 0x00007fdb30054c60<br>3 libc.so.6 0x00007fdb2f33fd05 gsignal + 53<br>4 libc.so.6 0x00007fdb2f343ab6 abort + 390<br>
5 libc.so.6 0x00007fdb2f3387c5 __assert_fail + 245<br>6 opt 0x000000000051a9a6<br>7 opt 0x000000000051979e<br>8 opt 0x0000000000503863<br>9 opt 0x000000000050102e<br>
10 opt 0x0000000000689184 llvm::LPPassManager::runOnFunction(llvm::Function&) + 836<br>11 opt 0x0000000000801f9f llvm::FPPassManager::runOnFunction(llvm::Function&) + 351<br>12 opt 0x000000000080221b llvm::FPPassManager::runOnModule(llvm::Module&) + 59<br>
13 opt 0x000000000080236a llvm::MPPassManager::runOnModule(llvm::Module&) + 282<br>14 opt 0x0000000000802941 llvm::PassManagerImpl::run(llvm::Module&) + 337<br>15 opt 0x0000000000802e4a llvm::PassManager::run(llvm::Module&) + 10<br>
16 opt 0x00000000004919d7 main + 5511<br>17 libc.so.6 0x00007fdb2f32aeff __libc_start_main + 255<br>18 opt 0x000000000048bc95<br>Stack dump:<br><br>If I don't use the opt -loop-reduce then this code runs fine. I'm not really sure the issue.<br>