title: GCC optimization of while loop with expression
body: <p>I have the following situation:</p>
  
  <pre><code>while (node != NULL &amp;&amp; has_all_except)
  {
    ...
  }
  </code></pre>
  
  <p>If neither <code>node</code> nor <code>has_all_except</code> are modified in the loop, will gcc optimize the loop to only compute the expression once?</p>
  
  <p>I have studied the Wikipedia article on compiler optimization (http://en.wikipedia.org/wiki/Compiler_optimization) but couldn't get a definite answer. My guts says it will be optimized.</p>