<div dir="ltr">One more.<div>Your original example was:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(80,0,80);font-size:12.8px">Consider these two accesses:</span><br style="color:rgb(80,0,80);font-size:12.8px"><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">    struct A { int i; };</span><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">    struct B { struct A a; } *b;</span><br style="color:rgb(80,0,80);font-size:12.8px"><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">    struct X { int i; } *x;</span><br style="color:rgb(80,0,80);font-size:12.8px"><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">    b->a</span><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">    x->i</span><br></blockquote><br></div><div><br></div><div>Do you believe the answer changes if you had struct A *x instead of struct X *x?<br>If so, why?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 19, 2017 at 10:58 AM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</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 Sat, Aug 19, 2017 at 10:48 AM, Ivan A. Kosarev <span dir="ltr"><<a href="mailto:ikosarev@accesssoftek.com" target="_blank">ikosarev@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    Daniel,<span class="m_8412307642842183516gmail-"><br>
    <br>
    > This is an aggregate type that includes a type compatible<br>
    > with the effective type of the object.  In particular,
    <div class="gmail_quote">> x->i is an lvalue expression of
      type "int"</div>
    <div class="gmail_quote">> b->a is an lvalue expression of
      type "struct A"</div>
    <div class="gmail_quote">> "struct A" is an aggregate type that
      includes "int" among<br>
      > its members.</div>
    </span><div class="gmail_quote"><span class="m_8412307642842183516gmail-">> Therefore, the b->a object may
      access x->i by TBAA<br>
      <br></span>
      My understanding is in x->i there are two accesses by lvalue,
      of which the first one is (*x) and that lvalue is of type that is
      not compatible with [any part of] struct A.</div></div></blockquote><div><br></div></span><div>Assume we split it as you suggest, into foo = *x, foo.i and bar = *b, b.a</div><div> </div><div>*x contains a struct containing an int.</div><div><br></div><div>*b contains a struct containing a struct containing an int</div><span class=""><div><br></div><span style="font-size:12.8px">" an aggregate or union type that includes one of the aforementioned types among its elements or nonstatic</span><br style="font-size:12.8px"><span style="font-size:12.8px">data members (including, recursively, an element or non-static data member of a subaggregate</span><br style="font-size:12.8px"><div><span style="font-size:12.8px">or contained union),"</span></div><div><span style="font-size:12.8px"><br></span></div></span><div><span style="font-size:12.8px">This seems to fall into the "including, recursively" part.</span></div><div><br></div><div>But, let's assume that is true for a second. </div><div><br></div><div>GIven</div><div>struct A *a</div><div>struct X *x</div><div><br></div><div>a->i</div><div>x->i</div><div><br></div><div>Can these accesses alias?</div><div><br></div><div><br></div><div>struct B *b</div><div>struct X *x</div><div><br></div><div>b->a.i</div><div>x->i</div><div><br></div><div>How about these?</div><div><br></div><div><br></div><div><br></div></div></div></div>
</blockquote></div><br></div>