<div dir="ltr">WFM; I'll put together a patch that only allows this under -fno-strict-aliasing.<div><br></div><div>I'm entirely unfamiliar with struct-path-tbaa, so Hal, do you see a reason why struct-path-tbaa wouldn't play nicely with flexible arrays at the end of types? Glancing at it, I don't think it should cause problems, but a more authoritative answer would really be appreciated. :) If it might cause issues now or in the future, I'm happy to be conservative here if -fno-strict-path-tbaa is given, too.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 13, 2016 at 2:00 PM, Joerg Sonnenberger via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@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"><span>On Tue, Sep 13, 2016 at 12:51:52PM -0700, Richard Smith wrote:<br>
> On Tue, Sep 13, 2016 at 10:44 AM, Joerg Sonnenberger via cfe-commits <<br>
> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
</span><span>> > IMO this should be restricted to code that explicitly disables C/C++<br>
> > aliasing rules.<br>
><br>
><br>
> Do you mean -fno-strict-aliasing or -fno-struct-path-tbaa or something else<br>
> here? (I think we're not doing anyone any favours by making _FORTIFY_SOURCE<br>
> say that a pattern is OK in cases when LLVM will in fact optimize on the<br>
> assumption that it's UB, but I don't recall how aggressive<br>
> -fstruct-path-tbaa is for trailing array members.)<br>
<br>
</span>The former immediately, the latter potentially as well. I can't think of<br>
many use cases for this kind of idiom that don't involve type prunning<br>
and socket code is notoriously bad in that regard by necessity.<br>
<div><div><br>
Joerg<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>