<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:sfantao@us.ibm.com" title="Samuel Antao <sfantao@us.ibm.com>"> <span class="fn">Samuel Antao</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED --- - Firstprivate in for directive does not work properly."
href="https://llvm.org/bugs/show_bug.cgi?id=27828">bug 27828</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED --- - Firstprivate in for directive does not work properly."
href="https://llvm.org/bugs/show_bug.cgi?id=27828#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED --- - Firstprivate in for directive does not work properly."
href="https://llvm.org/bugs/show_bug.cgi?id=27828">bug 27828</a>
from <span class="vcard"><a class="email" href="mailto:sfantao@us.ibm.com" title="Samuel Antao <sfantao@us.ibm.com>"> <span class="fn">Samuel Antao</span></a>
</span></b>
<pre>Hi Alexey,
Sorry I messed up the repro when I was reducing it. So, here's an updated one
that shows the problem:
#include <stdio.h>
int main(void) {
int a = 2;
#pragma omp parallel if(0)
{
#pragma omp for firstprivate(a)
for (int i = 0; i < 1; i++) {
printf(" Hi from first loop --> %d!\n", a);
a += 1;
}
#pragma omp for firstprivate(a)
for (int i = 0; i < 1; i++) {
printf(" Hi from second loop --> %d!\n", a);
a += 1;
}
}
printf(" Final --> %d\n", a);
return 0;
}
I get:
Hi from first loop --> 2!
Hi from second loop --> 3!
Final --> 2
So `a` is privatized in the parallel scope but not for each loop.
Thanks!
Samuel</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>