Am Wed, 30 Jul 2014 17:32:10 -0700 schrieb Andrei Alexandrescu <seewebsiteforem...@erdani.org>:
> On 7/30/14, 5:29 PM, Andrei Alexandrescu wrote: > > On 7/30/14, 4:51 PM, Tobias Müller wrote: > >> With relatively 'dumb' compilers, this is not a big problem, but > >> optimizers > >> are more and more clever and will take profit of such assumptions > >> if they can. > > > > That's true, and it seems like a growing trend. Relevant threads: > > > > https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/9S5jNRW-5wY > > > > > > http://www.spinics.net/lists/gcchelp/msg41714.html > > > > Recent versions of gcc and clang have become increasingly aggressive > > about optimizing code by taking advantage of making undefined > > behavior _really_ undefined. There's been a couple of posts in the > > news recently that I can't find at the moment. > > I think I found it: http://www.redfelineninja.org.uk/daniel/?p=307 > > Andreu > Also this: Linus Torvalds On GCC 4.9: Pure & Utter Crap http://www.phoronix.com/scan.php?page=news_item&px=MTc1MDQ (This actually is a GCC bug, but valid behaviour for normal C++ code. GCC only broke the compiler switch to explicitly force non-standard behaviour)