title: Can gcc/g++ tell me when it ignores my register?
body: <p>When compiling C/C++ codes using gcc/g++, if it ignores my register, can it tell me?
  For example, in this code</p>
  
  <pre><code>int main()
  {
      register int j;
      int k;
      for(k = 0; k &lt; 1000; k++)
          for(j = 0; j &lt; 32000; j++)
              ;
      return 0;
  }
  </code></pre>
  
  <p>j will be used as register, but in this code</p>
  
  <pre><code>int main()
  {
      register int j;
      int k;
      for(k = 0; k &lt; 1000; k++)
          for(j = 0; j &lt; 32000; j++)
              ;
      int * a = &amp;j;
      return 0;
  }
  </code></pre>
  
  <p>j will be a normal variable.
  Can it tell me whether a variable I used register is really stored in a CPU register?</p>