Unfortunately, I cannot provide the exact code, but I will attempt to look for the reason and post a test case.<br><br><br><div class="gmail_quote">On Tue, Feb 7, 2012 at 6:04 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Feb 7, 2012 at 5:52 PM, Ryan Taylor <<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>> wrote:<br>

> opt: /home/ryan/llvm/llvm_core/llvm-3.0/include/llvm/Support/Casting.h:194:<br>
> typename cast_retty<Instruction, User *>::ret_type llvm::cast(llvm::User<br>
> *const &): Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible<br>
> 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<br>
> llvm::LPPassManager::runOnFunction(llvm::Function&) + 836<br>
> 11 opt             0x0000000000801f9f<br>
> llvm::FPPassManager::runOnFunction(llvm::Function&) + 351<br>
> 12 opt             0x000000000080221b<br>
> llvm::FPPassManager::runOnModule(llvm::Module&) + 59<br>
> 13 opt             0x000000000080236a<br>
> llvm::MPPassManager::runOnModule(llvm::Module&) + 282<br>
> 14 opt             0x0000000000802941<br>
> llvm::PassManagerImpl::run(llvm::Module&) + 337<br>
> 15 opt             0x0000000000802e4a llvm::PassManager::run(llvm::Module&)<br>
> + 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<br>
> sure the issue.<br>
<br>
</div></div>It's hard to say what is happening without a testcase.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br>