<div dir="ltr">On Thu, Aug 22, 2013 at 6:40 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.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 class="im">It's a known limitation, see ScalarEvolution.cpp:5568.</div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>The fundamental problem is that len in your example could be (unsigned) -1, -2 or -3, in which case your loop is infinite.</div>
</div></div></div></blockquote><div><br></div><div>Unless I'm missing something, if len is -1 (or otherwise less than 0) the loop has 0 trip count. Did you mean INT_MAX-1, INT_MAX-2 etc? In this case, I believe, the behavior is undefined, because adds are marked with "nsw".</div>
<div><br></div><div>Eugene</div></div>