https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63249
Bug ID: 63249 Summary: [OpenMP] Spurious »set but not used« warnings when actually used in OpenMP target's array section's lower-bound and length Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org CC: jakub at gcc dot gnu.org Depends on: 63248 This is similar to what has previously been addressed in <https://gcc.gnu.org/PR51360>, <http://news.gmane.org/find-root.php?message_id=%3C20111215173852.GT1957%40tyan-ft48-01.lab.bos.redhat.com%3E>: int f(int A, int B) { int r = 0; extern int *v; int a = 2; int b = 4; int n = 3; v[n] = 0; #pragma omp target map(to: v[a:b]) r |= v[n]; #pragma omp target map(to: v[A:B]) r |= v[n]; return r; } ../../openacc/w.c: In function 'f': ../../openacc/w.c:6:7: warning: variable 'b' set but not used [-Wunused-but-set-variable] int b = 4; ^ ../../openacc/w.c:5:7: warning: variable 'a' set but not used [-Wunused-but-set-variable] int a = 2; ^ ../../openacc/w.c:1:11: warning: parameter 'A' set but not used [-Wunused-but-set-parameter] int f(int A, int B) ^ ../../openacc/w.c:1:18: warning: parameter 'B' set but not used [-Wunused-but-set-parameter] int f(int A, int B) ^ Patch (for C) submitted in <http://news.gmane.org/find-root.php?message_id=%3C87y4trrcsk.fsf%40schwinge.name%3E>, C++ blocked on PR63248.