public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104913] New: [OpenMP] Bogus 'unused variable' with 'omp depobj'
@ 2022-03-14 11:23 burnus at gcc dot gnu.org
  2022-03-14 12:41 ` [Bug c/104913] " jakub at gcc dot gnu.org
  2022-03-14 13:33 ` jakub at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-03-14 11:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104913
           Summary: [OpenMP] Bogus 'unused variable' with 'omp depobj'
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic, openmp
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

The following C code shows the warning

foo.c:6:7: warning: unused variable ‘x’ [-Wunused-variable]
    6 |   int x;
      |       ^

but the variable is used in 'depend(inout: x)'.

(No warning for the Fortran code, which is fine. Found when looking at
https://github.com/SOLLVE/sollve_vv/pull/493 which then uses obj with
omp_target_memcpy_async.)


-----------------------
#include <omp.h>

void
foo ()
{
  int x;
  omp_depend_t obj;
  #pragma omp depobj(obj) depend(inout: x)
}
-----------------------
subroutine foo
  use omp_lib
  implicit none
  integer :: x
  integer(omp_depend_kind) obj
  !$omp depobj(obj) depend(inout: x)
end

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-14 13:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 11:23 [Bug c/104913] New: [OpenMP] Bogus 'unused variable' with 'omp depobj' burnus at gcc dot gnu.org
2022-03-14 12:41 ` [Bug c/104913] " jakub at gcc dot gnu.org
2022-03-14 13:33 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).