https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69876

            Bug ID: 69876
           Summary: Offloaded code: missing -Wuninitialized diagnostic
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: openacc, openmp
          Severity: minor
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Found in the course of PR69858.  Consider:

    int f(void)
    {
      int x;
    #pragma omp target map(from:x)
      x++;

      return x;
    }

Compiling with -fno-openmp, we get the expected -Wuninitialized diagnostic:

    w.c:5:4: warning: 'x' is used uninitialized in this function
[-Wuninitialized]
       x++;
       ~^~

Compiling with -fopenmp, we don't get the -Wuninitialized diagnostic.

Reply via email to