Commit 8c8074f
authored
[Flang][OpenMP] Fix OpenMP static scheduling when trip count is zero (#170863)
Code-gen produced incorrect code for cases when the trip count an
associated DO loop was zero. The generated code evaluated the trip count
of the loop and substracted 1 from it. When this was passed to
__kmpc_for_static_init_4u, the value was interpreted as unsigned, which
made the upper bound of the worksharing loop 2^32-1 and caused a
division by zero in the calculation of the loop bounds for the threads.1 parent fdd0d53 commit 8c8074f
File tree
2 files changed
+7
-2
lines changed- clang/test/OpenMP
- llvm/lib/Frontend/OpenMP
2 files changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5140 | 5140 | | |
5141 | 5141 | | |
5142 | 5142 | | |
5143 | | - | |
| 5143 | + | |
| 5144 | + | |
| 5145 | + | |
| 5146 | + | |
5144 | 5147 | | |
5145 | 5148 | | |
5146 | 5149 | | |
| |||
0 commit comments