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).