| Issue |
64693
|
| Summary |
OpenMP parallel reduction gives wrong result with clang on Windows
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
annop-w
|
Compiling this program with clang++ -fopenmp -O3 prints wrong result for some number of OMP_NUM_THREADS.
```
#include <iostream>
int main () {
double sum = 0.0;
#pragma omp parallel for default(none) reduction(+:sum)
for (int i = 0; i < 1000; ++i) {
sum += 1.0;
}
std::cout << sum << std::endl;
return 0;
}
```
```
# clang++ --version
clang version 16.0.0
Target: aarch64-pc-windows-msvc
Thread model: posix
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs