<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Constant firstprivate argument in target region not passed correctly to parallel region"
href="https://bugs.llvm.org/show_bug.cgi?id=51028">51028</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Constant firstprivate argument in target region not passed correctly to parallel region
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>OpenMP
</td>
</tr>
<tr>
<th>Assignee</th>
<td>a.bataev@hotmail.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>huberjn@ornl.gov
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Any constant non-scalar data type that is mapped firstprivate into a target
region will not be correctly copied to the parallel region if executing in
generic mode. This regression was caused by D105375. Here is a small
reproducer.
#include <complex>
#include <cstdio>
void foo(const std::complex<double> X, std::complex<double> Y) {
#pragma omp target firstprivate(X) map(from:Y)
{
printf ("Outside parallel: %f + %fi\n", X.real(), X.imag());
#pragma omp parallel firstprivate(X)
{
printf ("Inside parallel: %f + %fi\n", X.real(), X.imag());
Y = X;
}
}
}
int main() {
std::complex<double> X = {1.0, 1.0};
std::complex<double> Y;
foo(X, Y);
}
Outside parallel: 1.000000 + 1.000000i
Inside parallel: 0.000000 + 0.000000i</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>