<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 19, 2017 at 11:27 AM, Ivan A. Kosarev via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Daniel,<span class=""><br><br></span></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""> ....<br></span></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">the type of (*x) is not compatible with the type of (*b) or, recursively, type of b->i. Similarly, the type of (*b) is not compatible with (*x) or, recursively, x->i.<span class=""><br>
<br></span></blockquote><div><br></div><div>I'm not sure i'd agree with this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> But, let's assume that is true for a second.<br>
> GIven<br>
> struct A *a<br>
> struct X *x<br>
><br>
> a->i<br>
> x->i<br>
><br>
> Can these accesses alias?<br></span><span class="">...<br></span></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""></span>
No alias. struct X is not compatible with struct A.<span class=""><br>...<br></span></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""></span>
No alias. Same reason.<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>I think these are interesting interpretations. I'm not sure i'd personally agree with them (and there are definitely compilers out there that do not). It gets more weird with unions. </div><div><br></div><div>But i'm also not going to say they are unreasonable, because i think the rules are sufficiently subject to reasonable interpretation already. There are things clearly allowed (IE everyone agrees) by the standard that no compiler allows, and things not allowed by the standard that all compilers allow.</div><div><br></div><div>(See the cerberus reports, which go through this in great detail for C).</div><div><br></div><div><br></div><div>That said, these interpretations allow significantly more optimization than we allow today, so if users are accepting of them, awesome.</div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div>