[cfe-dev] [LLVMdev] proposal for exploiting undefined behavior much more aggressively

Chandler Carruth chandlerc at google.com
Fri Jul 27 02:51:59 PDT 2012


On Fri, Jul 27, 2012 at 2:45 AM, David Chisnall <csdavec at swan.ac.uk> wrote:

> On 27 Jul 2012, at 09:35, annulen at yandex.ru wrote:
>
> > if someone has checked the code and found it UB-free he could allow
> aggressive UB exploiting.
>
> Surely code that contains no undefined behaviour will gain no benefits
> from optimisations that exploit undefined behaviour?
>

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.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120727/f3de1948/attachment.html>


More information about the cfe-dev mailing list