<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 - Wrong number of dependencies when using OpenMP iterator()"
   href="https://bugs.llvm.org/show_bug.cgi?id=52010">52010</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong number of dependencies when using OpenMP iterator()
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>OpenMP
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rpenacob@bsc.es
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, rofirrim@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In the following test case kmp_depend_info array size and the number of
dependencies passed to __kmpc_omp_task_with_deps is wrongly computed.

// t1.c
int x[100];
int y[100];
void foo() {
    #pragma omp task depend(iterator(j=0:5), in: x[j], y[j])
    {
    }
}
void bar() {
    #pragma omp task depend(iterator(j=0:5), in: x[j]) depend(iterator(j=0:5),
in: y[j])
    {
    }
}


Looking at the IR code with : clang -fopenmp -S -emit-llvm t1.c 

; Size 5, but it is 5*2 = 10
define dso_local void @foo() #0 {
  ...
  %vla = alloca %struct.kmp_depend_info, i64 5, align 16
  %28 = call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @1, i32 %0, i8*
%1, i32 5, i8* %27, i32 0, i8* null)

}

; Size 25, but it is 10
define dso_local void @bar() #0 {
...
  %vla = alloca %struct.kmp_depend_info, i64 25, align 16
  %32 = call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @1, i32 %0, i8*
%1, i32 25, i8* %31, i32 0, i8* null)
}</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>