<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - Wrong DSA for members in struct."
href="https://llvm.org/bugs/show_bug.cgi?id=31137">31137</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Wrong DSA for members in struct.
</td>
</tr>
<tr>
<th>Product</th>
<td>OpenMP
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Clang Compiler Support
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>philippe.44@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=17637" name="attach_17637" title="Proposed patch">attachment 17637</a> <a href="attachment.cgi?id=17637&action=edit" title="Proposed patch">[details]</a></span>
Proposed patch
The following code fails with clang's master:
----
#include<assert.h>
struct s {
int a;
int b;
};
int main()
{
#pragma omp parallel
#pragma omp single
{
struct s S = {0,0};
#pragma omp task
{
/*(void)S;*/
S.a = 1;
}
#pragma omp taskwait
assert(S.a == 0);
}
}
----
'S' is detected as shared when I think it's actually firstprivate, it worked in
3.8, and uncommenting the "(void)S;" make it pass.
It seems that visiting MemberExpr when checking DSA attributes has been added
for 3.9, but the base is not visited if it's anything but a "this", when I
think it should.
I've attached a small patch fixing the bug, if my previous reasoning is ok it
should be enough.
I'm not sure about the follow up for this: please let me know if I should
submit the patch directly and if I should also submit one to add the small test
to libomp's testsuite.</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>