<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/102949>102949</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang][openmp] Bad code for "private" clause and named common
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
psteinfeld
</td>
</tr>
</table>
<pre>
Here's a reproducer:
```
Program bug
Real :: x
Common /named_common/ x
x = 1.0
Call sub()
If (x/=1.0) Then
Print *,'FAIL common, x: ',x
Else
Print *,'ok'
End If
contains
Subroutine sub
Real :: x
Common /named_common/ x
!$OMP PARALLEL PRIVATE (/named_common/)
x = 2.0
!$OMP END PARALLEL
End Subroutine
End Program
```
If I compile and execute this program with the `-fopenmp` option, I get the output:
```
FAIL common, x: 2.
```
Alternatively, gfortran produces the output:
```
ok
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU9FuozoQ_ZrhZdQIBkjCAw80CbqRcu-NutW-rgw24K3ByDbZ9O9XEJJUVSo1ioR8fGbGc-YMs1bWnRApxM8Qbz02uEabtLdOyK4SinuF5u_pP8IIoJVFhkb0RvOhFAbCDPwt-Bks_fk_HY9G14a1WAz1BUB8EUzhyA8zPF_BjW5b3SFQ3rFW8F_ldAbK75QzQrjFYOHfYphSaIcCaA2UXNF9hUDrM1AO4XZkU4Kvjeiu94hHIzuHQBnQBmiVZ_sDXutt8Dy-C2gFtLmV3ikrvozXbyP7yuw47qvLqdSdY7Kz892PoTB6cLIT06Nv6R7q8S1FEIECoOj_f494zF6yw2F3wOPL_mf2usNJlc-xH3QafxdJ6S7px4y7_7a3rB_bu_dxQUdsHvNDC-wr3I_69lIJZB1HcRbl4AS6RlrsZ4P8ka5B1wiEpf9U6V50bQ9LH3Xv5GUwe6yFmyh6cP3gvrIcPhoo0uIhOVNOmI45eRLqfWTXlTbOsA5nZ9vvVNRvn3CPpyFPwoR5Ig1WFEbrVbyMvSZljC-jcsXjVRXxMPSLMGYlL_0gqMIwKUpPpuRT5K8DCtYhRfGClZUoBC8inqzDqPQh8kXLpFoodWoX2tSetHYQaeBTEiWeYoVQdlphokqxrgaicZtNOgY8FUNtIfKVtM7eUzjp1LT3l4h4C_HzPIN4i8-MY6m5wEobBKLeyBNzAoiwVGywl7FOVpt19waj0sa53o6ajb7La-maoViUugXKx8Lz56k3-rcoHVA-NWKB8rmXU0p_AwAA__8Hr0_n">