[llvm-bugs] [Bug 45132] New: OpenMP doacross loop nest with a decreasing induction variable abends
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Mar 5 18:50:00 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=45132
Bug ID: 45132
Summary: OpenMP doacross loop nest with a decreasing induction
variable abends
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: OpenMP
Assignee: unassignedclangbugs at nondot.org
Reporter: t-kawashima at fujitsu.com
CC: llvm-bugs at lists.llvm.org
Created attachment 23210
--> https://bugs.llvm.org/attachment.cgi?id=23210&action=edit
doacross.1.c in OpenMP 4.5 exmaples with reverse-order modification
[Envinronment]
OS: Linux
CPU: x86_64 and AArch64
LLVM/Clang/OpenMP: latest master branch (commit cfff4851acc)
The attached program `doacross.reverse.c` is a modified version of
`doacross.1.c` in the official 'OpenMP Examples Version 4.5.0' (page 194)
<https://github.com/OpenMP/Examples/blob/v4.5.0/sources/Example_doacross.1.c>.
The modified points are:
- decrease the induction variable `i` (see the diff below)
- change `depend(sink: i+1)` to depend(sink: i-1) (see the diff below)
- implement `foo`, `bar`, `baz`, and `main`
--------------------------------
#pragma omp for ordered(1)
- for (i=N-1; i>1; i--)
+ for (i=1; i<N; i++)
{
A[i] = foo(i);
- #pragma omp ordered depend(sink: i+1)
+ #pragma omp ordered depend(sink: i-1)
B[i] = bar(A[i], B[i-1]);
#pragma omp ordered depend(source)
C[i] = baz(B[i]);
}
--------------------------------
When this program is compiled with -fopenmp and executed, a segmentation fault
occurs.
--------------------------------
$ clang -fopenmp doacross.reverse.c
$ ./a.out
Segmentation fault
--------------------------------
The number of threads is irrelevant. I can reproduce it with OMP_NUM_THREADS=2.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200306/718f4aaf/attachment.html>
More information about the llvm-bugs
mailing list