Maybe it's something like that https://news.ycombinator.com/item?id=3742902
I do wonder why this issue has never been fixed?!
The point on benchmarking the right thing is 100% spot on, same goes for testing too. The optimization problem however is a bit too contrived IMO. When would you possible write code (aside from very trivial things) where the compiler would optimize all your code away, thus making your benchmarking invalid? I want to see a real-world example of where someone has been caught out by this?