Closed peihunglin closed 7 years ago
@peihunglin: thank you for reporting this. Do you actually have a reproducer? We probably want to put that into our CI testing.
One of the test is like the following and the test platform is Intel(R) Xeon(R) CPU E5-2699 v3:
#define num_steps 2000000000
int main(int argc, char** argv)
{
double pi = 0;
int i;
#pragma omp parallel for reduction(+:pi)
for (i = 0; i < num_steps; i++) {
pi += 1.0 / (i * 4.0 + 1.0);
}
pi = pi * 4.0;
return 0;
}
@peihunglin: thanks for reporting the issue and the reproducer. This issue is now fixed in OpenMPToolsInterface/LLVM-openmp@d081872ea4764a72f5955b8fd11513b5c3522f8d
For Archer using openmp/towards_tr4 and archer/towards_tr4, we encounter segmentation fault frequently with OpenMP reduction. The segmentation fault would show up when using more than 4 OpenMP threads in the testing.