Commit f3d74ae
committed
[flang][OpenMP] Fix crash when a sliced array is specified in forall construct within workshare construct
This is fix for two problems:
1. Thread-local variables sometimes are required to be paralellized. Added a
special case to handle this in LowerWorkshare.cpp:isSafeToParallelize.
2. Race condition caused by a `nowait` added to the omp.workshare if it is the
last operation in a block. This allowed multiple threads to execute the
omp.workshare region concurrently. Since _FortranAPushValue modifies a
shared stack, this concurrent access causes a crash. Disable the addition of
`nowait` and rely on the implicit barrier at the the of the omp.workshare
region.
Fixes #1433301 parent 254b33f commit f3d74ae
File tree
1 file changed
+47
-2
lines changed- flang/lib/Optimizer/OpenMP
1 file changed
+47
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
141 | 181 | | |
142 | 182 | | |
143 | 183 | | |
| |||
335 | 375 | | |
336 | 376 | | |
337 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
338 | 383 | | |
339 | 384 | | |
340 | 385 | | |
| |||
0 commit comments