<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - An iteration of a loop execute more than one ordered region which throw an error"
   href="https://bugs.llvm.org/show_bug.cgi?id=46347">46347</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>An iteration of a loop execute more than one ordered region which throw an error
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yangzh.fnst@cn.fujitsu.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi,

Follow the OpenMP's Specfications:
During execution of an iteration of a worksharing-loop or a loop nest within a
worksharing-loop, simd, or worksharing-loop SIMD region, a thread must not
execute more than one ordered region corresponding to an ordered construct
without a depend clause.
<a href="https://www.openmp.org/spec-html/5.0/openmpsu97.html#x128-5010002.17.9">https://www.openmp.org/spec-html/5.0/openmpsu97.html#x128-5010002.17.9</a>

The following code shoule be error. But there is no error.

Example_ordered.2.c: This code comes from 
<a href="https://www.openmp.org/wp-content/uploads/openmp-examples-5.0.0.pdf">https://www.openmp.org/wp-content/uploads/openmp-examples-5.0.0.pdf</a>

void work(int i) {}

void ordered_wrong(int n)
{
  int i;
  #pragma omp for ordered
  for (i=0; i<n; i++) {
/* incorrect because an iteration may not execute more than one
   ordered region */
    #pragma omp ordered
      work(i);
    #pragma omp ordered
      work(i+1);
  }
}

clang version: clang10.0.0
command:
clang -fopenmp -S test.c</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>