<div class="gmail_quote">On Tue, Mar 13, 2012 at 1:23 AM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":6d">maybe I'm missing something, but are all compares really guaranteed to produce a<br>
constant result here?</div></blockquote></div><br><div>We check below that the LHS and RHS are the "related" pointers. The idea is that the LHS is derived from the RHS (or vice versa) via constant operations. Thus the comparison of them will produce some constant.</div>
<div><br></div><div>Think of it this way, all comparison outcomes can be determined by inspecting some aspect of the result of a subtraction. In the same way that the subtraction removes the non-constant base pointer leaving only the constant relationship, the comparison will as well.</div>