Issue 144827
Summary [openmp][clang] Compilation error for omp update directive when multi dimension array is allocated on heap
Labels clang
Assignees
Reporter aywala
    ```cpp
#include <stdio.h>
#include <stdlib.h>
  
int main() {
    int **a = (int**)malloc(100*sizeof(int*));
    for(int i=0;i<100;i++) {
        a[i] = (int*)malloc(100*sizeof(int));
    }
    for(int i=0;i<100;i++) {
 for(int j=0;j<100;j++) {
            a[i][j]=0;
        }
    }
  
 #pragma omp target data map(tofrom: a[0:1][0:100])
        {
 #pragma omp target teams
                #pragma omp distribute
 for (int j = 0; j < 100; j++) {
                        a[0][j] += j;
                    }
            #pragma omp target update from(a[0:1][0:100])
        }
 
    printf("a[0][10]: %d\n", a[0][10]);
}
```
```
<source>:22:44: error: section length is unspecified and cannot be inferred because subscripted value is an array of unknown bound
   22 |             #pragma omp target update from(a[0:1][0:100])
 |                                            ^
1 error generated.
```
https://godbolt.org/z/h5vha6E5v
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to