This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70550] New: -Wuninitialized false positives in OpenMP code
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 05 Apr 2016 15:41:47 +0000
- Subject: [Bug c/70550] New: -Wuninitialized false positives in OpenMP code
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70550
Bug ID: 70550
Summary: -Wuninitialized false positives in OpenMP code
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
#ifdef __SIZEOF_INT128__
typedef __int128 T;
#else
typedef long long T;
#endif
void bar (T);
#pragma omp declare target (bar)
void
foo (void)
{
{
int i;
#pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used
uninitialized in this function" } */
{
i = 26;
bar (i);
}
}
{
T j;
#pragma omp target defaultmap(tofrom:scalar) /* { dg-bogus "is used
uninitialized in this function" } */
{
j = 37;
bar (j);
}
}
{
int i;
#pragma omp target /* { dg-bogus "is used
uninitialized in this function" } */
{
i = 26;
bar (i);
}
}
{
T j;
#pragma omp target /* { dg-bogus "is used
uninitialized in this function" } */
{
j = 37;
bar (j);
}
}
{
int i;
#pragma omp target firstprivate (i) /* { dg-warning "is
used uninitialized in this function" } */
{
i = 26;
bar (i);
}
}
{
T j;
#pragma omp target firstprivate (j) /* { dg-warning "is
used uninitialized in this function" } */
{
j = 37;
bar (j);
}
}
{
int i;
#pragma omp target private (i) /* { dg-bogus "is used
uninitialized in this function" } */
{
i = 26;
bar (i);
}
}
{
T j;
#pragma omp target private (j) /* { dg-bogus "is used
uninitialized in this function" } */
{
j = 37;
bar (j);
}
}
}
shows some warnings that are IMNSHO desirable (explicit uses of firstprivate
clause with uninitialized var), and others where it is undesirable (mostly
implicit clauses).