<br><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 27, 2012 at 2:45 AM, David Chisnall <span dir="ltr"><<a href="mailto:csdavec@swan.ac.uk" target="_blank" class="cremed">csdavec@swan.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 27 Jul 2012, at 09:35, <a href="mailto:annulen@yandex.ru" class="cremed">annulen@yandex.ru</a> wrote:<br>

<br>
> if someone has checked the code and found it UB-free he could allow aggressive UB exploiting.<br>
<br>
</div>Surely code that contains no undefined behaviour will gain no benefits from optimisations that exploit undefined behaviour?<br></blockquote><div><br></div><div>Free for a particular dynamic execution. Thus the undefined behavior which is being used to optimized does not, dynamically, occur in the executions of the program we are considering.</div>
<div><br></div><div>This is the classical place where such optimizations are useful. Some external constraint prevents execution of the code dynamically, and we would like to allow the compiler to optimize under such an assumption statically due to the presence of UB.</div>
</div></div>