<div dir="ltr">What is the purpose of the union there?<br>I ask because pretty much no compiler will respecting the unioning without visible accesses  in all cases, because it would ruin most optimization[1]<div><br></div><div>But i'm also not sure it's required in this testcase to make your testcase fail.</div><div><br></div><div>In practice, handling placement new properly in gcc required the equivalent of a new intrinsic (in gcc, it required adding CHANGE_DYNAMIC_TYPE_EXPR).</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>[1]  For example, you can pretty much get every compiler out there to generate "wrong" code using unions and strict aliasing,  see the last discussion we had about this on the mailing list (subject line had "wrong results with union and strict-aliasing").</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 24, 2016 at 2:40 PM, Hubert Tong 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"><div dir="ltr"><div><div>I've heard from a few people that placement new is going to be handled by LLVM using the <span style="font-family:monospace,monospace">llvm.invariant.group.barrier intrinsic</span>; however, the documentation for that intrinsic seems to indicate that it deals with only <span style="font-family:monospace,monospace">invariant.group</span> metadata and not TBAA metadata.<br><br></div>I would like to understand how the solution would work in the context of <a href="https://llvm.org/bugs/show_bug.cgi?format=multiple&id=28767" target="_blank">https://llvm.org/bugs/show_<wbr>bug.cgi?format=multiple&id=<wbr>28767</a>.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">-- HT<br></font></span></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>