title: OpenMP collapse gives wrong results
body: <p>I have an 3D array <code>z</code>, where every element has the value <code>1</code>.</p>
  
  <p>Now I do:</p>
  
  <pre><code>#pragma omp parallel for collapse(3) shared(z)
  for (int i=0; i &lt; SIZE; ++i) {
      for (int j=0; j &lt; SIZE; ++j) {
          for (int k=0; k &lt; SIZE; ++k) {
              for (int n=0; n &lt; ITERATIONS-1; ++n) {
                  z[i][j][k] += 1;
              }
          }
      }
  }
  </code></pre>
  
  <p>This should add <code>ITERATIONS</code> to each element and it does. If I then change the <code>collapse(3)</code> to <code>collapse(4)</code> (because there are 4 for-loops) I don't get the right result.</p>
  
  <p>Shouldn't I be able to collapse all four loops?</p>