<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 1, 2016 at 5:08 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">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">eli.friedman added a subscriber: eli.friedman.<br>
<br>
================<br>
Comment at: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp:842<br>
@@ +841,3 @@<br>
+ // of the same struct, they do not alias.<br>
<span class="">+ if (GEP1->isInBounds() && GEP2->isInBounds()) {<br>
</span>+ auto Opi1 = GEP1->op_begin() + 1;<br>
----------------<br>
You aren't allowed to make aliasing assumptions based on the type of a GEP;</blockquote><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> it's just pointer math. "inbounds" just means that the result has to be in bounds relative to the allocation as a whole. See <a href="http://llvm.org/docs/LangRef.html#getelementptr-instruction" rel="noreferrer" target="_blank">http://llvm.org/docs/LangRef.html#getelementptr-instruction</a> .<br>
<br></blockquote><div><br></div><div>It's still, AFAIK, proving that that the pointer math comes out different for those two geps.</div><div>That is, those two geps generate different pointers.</div><div><br></div><div>It doesn't say the access is illegal in some way, it simply says "field a and b aren't at the same offset, so this gep and that gep, converted to pointers to anything, can't be the same pointer".</div><div><br></div><div><br></div><div><br></div></div></div></div>