<div dir="ltr">Input to this pass is the bitcode format of simple code below : <br><br>int sum_single_loop (int a){<br>   int su = 0, i;<br>   for (i=0;i<a;i++)<br>      su = su + i;<br>   return su;<br>}<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 9, 2015 at 2:32 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@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 dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Sun, Feb 8, 2015 at 11:23 AM, Pranav Kant <span dir="ltr"><<a href="mailto:pranav913@gmail.com" target="_blank">pranav913@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 dir="ltr"><div><div><div>So, you mean to say that the above implementation is correct and should work fine. <br></div></div></div></div></blockquote></span><div><br>So far as I can see - but I could be missing something.<br> </div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I initially thought that the above way is not the correct way anymore since 3.5.0 might have changed few things. <br></div><br></div>Anyways here is my dirty code I have written for my research project that I took the above snippet from :<br><br><a href="https://github.com/pranavk/spatial-computing/blob/master/waves.cpp#L105" target="_blank">https://github.com/pranavk/spatial-computing/blob/master/waves.cpp#L105</a></div></div></blockquote></span><div><br>Someone (not necessarily me) will presumably need the input/command/arguments/whatever required to trigger the infinite loop in this code that you're seeing, as well as the code there.<br> </div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br><br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 8, 2015 at 10:25 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">This may be difficult yo reproduce or debug without a more complete (though preferably minimal) test case.</p>
<div class="gmail_quote"><div><div>On Feb 8, 2015 8:31 AM, "Pranav Kant" <<a href="mailto:pranav913@gmail.com" target="_blank">pranav913@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">void Wave::init (const Function &F){<br><div class="gmail_quote"><div dir="ltr"><div>    Function::const_iterator ie = F.end();<br></div><div>    outs() << ie << "\n\n";<br></div><div>    for (Function::const_iterator I = F.begin(), IE = F.end(); I != IE; I++, K++){<br></div><div>       outs() << I << "\n";<br></div>       // some manipulation with I<br><div><div><div>    }<br>}<br><br></div><div>I used the above shown function in my pass in LLVM 3.4.2 and it used to work fine but when I am compiling this pass with 3.5.0, this is a never ending loop. Can someone please suggest me what can be wrong here ?<br><br></div><div>Upon some debugging, I found out that const_iterator I never becomes equal to IE, rather it goes past IE when incremented and hence loop never ends.<br><br></div><div>Following is the output upon executing above code.<br><br>0x2e08248 <- address of ie<br>0x2e16630 <- address of I initially<br>0x2e08250 <- incremented I<br>0x2e165e0<br>0x2e16630<br>0x2e08250<br>0x2e165e0<br>0x2e16630<br>0x2e08250<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div><br><br clear="all"><div><div><br>-- <br><div><div dir="ltr"><div>Regards,<br>Pranav Kant,<br></div><div>Department of Computer Science<br>National Institute of Technology Hamirpur<br></div><div><a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br></div></div></div>
</div></div></div></font></span></div></div></div>
</div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div>Regards,<br>Pranav Kant,<br></div><div>Department of Computer Science<br>National Institute of Technology Hamirpur<br></div><div><a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br></div></div></div>
</div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div>
</blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div>Regards,<br>Pranav Kant,<br></div><div>Department of Computer Science<br>National Institute of Technology Hamirpur<br></div><div><a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br></div></div></div>
</div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Regards,<br>Pranav Kant,<br></div><div>Department of Computer Science<br>National Institute of Technology Hamirpur<br></div><div><a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br></div></div></div>
</div>