https://bugs.llvm.org/show_bug.cgi?id=45717
Bug ID: 45717
Summary: OpenMP: array element not allowed in reduction clause
Product: OpenMP
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Clang Compiler Support
Assignee: unassignedclangb...@nondot.org
Reporter: david.pa...@intel.com
CC: llvm-bugs@lists.llvm.org
Compiler generates an error when array element is referred to in a reduction
clause. Spec seems to say this is valid, and other compilers accept it.
Test case:
static short x[100];
static short y[100];
static const int N = 100;
void test() {
short (*yptr)[N] = &y;
#pragma omp parallel for simd reduction(+:yptr[0])
for(int i = 0; i < N; i++) {
yptr[0][25 + i/4] += x[i];
}
}
Compile: clang -fopenmp test.cpp
Error:
test.cpp:8:43: error: list item of type 'int [100]' is not valid for specified
reduction operation: unable to provide default initialization value
#pragma omp parallel for simd reduction(+:yptr[0])
~ ^
test.cpp:7:11: note: 'yptr' defined here
int (*yptr)[N] = &y;
^
1 error generated.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs