title: Are the Optimization Keywords in C and C++ Reasonable?
body: <p>So we've all heard the don't-use-<code>register</code> line, the reasoning being that trying to out-optimize a compiler is a fool's errand.</p>
  
  <p><code>register</code>, from what I know, doesn't actually state anything about CPU registers, just that a given variable can't be referenced indirectly. I'll hazard a guess that it's often referred to as obsolete because compilers can detect a lack of addressing automatically thus making such optimizations transparent.</p>
  
  <p>But if we're firm on that argument, can't it be levelled at every optimization-driven keyword in C? Why do we use <code>inline</code> and C99's <code>restrict</code> for example?</p>
  
  <p>I suppose that some things like aliasing make deducing some optimizations <strong>hard</strong> or even impossible, so where is the line drawn before we start venturing into <a href="http://c2.com/cgi/wiki?SufficientlySmartCompiler">Sufficiently Smart Compiler</a> territory?</p>
  
  <p>Where should the line should be drawn in C and C++ between spoon-feeding a compiler optimization information and assuming it knows what it's doing?</p>
  
  <p><strong>EDIT</strong>: Jens Gustedt pointed out that my conflating of C and C++ isn't right since two of the keywords have semantic differences and one doesn't exist in standard C++. I had a good link about <code>register</code> in C++ which I'll add if I find it...</p>