<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 8:02 PM, 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"><div><div class="h5">[...]<span><br></span>However, another point to consider is that, "C++ standard experts, at least on the GCC side, did not 
view this as saying "all accesses must have an explicit union access", 
but that..." may not be a reasonable reading of the standard. The text says, "If a program attempts to access the stored value of an object through a glvalue of other than one<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000"><span>of the following types the behavior is undefined: ...", and so I read that as saying that the access must be through a glvalue of an aggregate or union type (with a relevant type as one of its members). So the union or aggregate type *must* be explicitly present in the access. I don't believe any other interpretations, especially those which imply non-local effects, are reasonable.</span><br><br>Exactly what rule did GCC implement?<br></div></div></blockquote><div><br></div></div></div><div>If you use an explicit union access, it assumes they alias,  otherwise, all bets are off.</div><div><br></div><div>Note: As you all know, I have really no dog in this fight, nor am i a language lawyer. Among other things, i'm an aliasing guy. I just do the edge of  what the language lawyers tell me is allowed :)</div><div><br></div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">I propose that we implement the same behavior in llvm.<br>I'm quite busy right now, but I'll try to come up with some examples later today for which we can then annotate what kind of behavior the standard would allow (using Richards interpretation), what gcc is doing, what we want to do.<br><br clear="all"></div><div class="gmail_extra">Greetings,<br></div><div class="gmail_extra"><br><div class="gmail_signature">Jeroen Dobbelaere<br></div>
</div></div>