3 ms·
> ongoing debate about the exploitation of undefined behavior by C compilers for optimization Can you provide some links to other examples of this?
by capisce 14y ago
> ongoing debate about the exploitation of undefined behavior by C compilers for optimization
Can you provide some links to other examples of this?
- pascal_cuoq 14y agoThere was much gnawing of teeth when compilers started to take advantage of the “strict aliasing rule”: http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-aliasing/ http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-... Programmers might think that it is okay to use uninitialized variables as a source of additional entropy (xoring with the real source of entropy), but it isn't, because the compiler will treat the uninitialized access as undefined behavior and eliminate code altogether: http://kqueue.org/blog/2012/06/25/more-randomness-or-less/ http://kqueue.org/blog/2012/06/25/more-randomness-or-less/ This 3-part blog post by Chris Lattner has various examples: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-...
- rcfox 14y agohttp://blog.regehr.org/archives/767 http://blog.regehr.org/archives/767