<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 2, 2015 at 9:07 AM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@britannica.bec.de" target="_blank">joerg@britannica.bec.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Jul 01, 2015 at 04:06:45PM +0100, Peter Sewell wrote:<br>
> - for some, OS developers are already routinely turning off<br>
> optimisations for the sake of more predictable semantics, e.g. with<br>
> fno-strict-aliasing.<br>
<br>
</span>This one is interesting, because the biggest problem with strict<br>
aliasing is that there is no standard compliant way to override it.<br>
The most basic issue is how the allocator is supposed to work<br>
internally. If you can fully inline malloc/free pairs, it is practically<br>
impossible to avoid aliasing conflicts.<br></blockquote><div><br></div><div>I thought strict aliasing was more about types? I think memcpy is the standard escape hatch there. Generally speaking a fixed-size memcpy into a local variable is optimized down into the load/store that you want. This is e.g. how Support/Endian.h works. Yes, this is very awkward, and there might be some namespacing issues when writing memcpy itself though :)</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Other important use cases are things like vectorizing access, which<br>
often means checking for the alignment of the data and casting to a more<br>
appropiate type. Not everyone wants to implement strlen in assembler,<br>
but writing a standard compliant and still fast implementation in C<br>
seems impossible.<br>
<span class="HOEnZb"><font color="#888888"><br>
Joerg<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div></div>