public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/94635] New: [OpenMP][Offloading] mapping with alloc/delete followed by map(from/fromto  fails
@ 2020-04-17 11:31 burnus at gcc dot gnu.org
  2020-04-17 11:41 ` [Bug libgomp/94635] [OpenMP][Offloading] mapping with alloc/delete followed by map(from/tofrom:) fails burnus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-04-17 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94635
           Summary: [OpenMP][Offloading] mapping with alloc/delete
                    followed by map(from/fromto  fails
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: openmp, wrong-code
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Based on an OpenMP test case from SOLLVE_VV,
   https://github.com/SOLLVE/sollve_vv/
Namely, based on
  tests/4.5/target_enter_exit_data/
    test_target_enter_exit_data_allocate_array_alloc_delete.F90

The following test case works if one comments:
  !$omp target enter data map(alloc: my1DPtr(:))
  !$omp target exit data map(delete: my1DPtr(:))
Then it prints the expected
  42 …
  10 …
  10 …
  20 …

If one comments only the "map(delete:…)", it prints
  42 …
  10 …
  0 …   (should be: 10)
  10 …  (should be: 20)

And with alloc/delete enabled, it prints:
  42 …
  10 …
  20 20 … 31911936 17 31907872 17 31907952 (should be: 10)
  10 …  (should be: 20)

In the 'target': when using "my1DArr = 99", the garbage values are replaced by
99, i.e.  20 20 … 99 99 …  (twelf times 20 followed by eight times 99).

The testsuite first tests whether alloc/delete works – which does; only
re-using the alloc/delete space fails.


Test case:
----------
  implicit none
  INTEGER, PARAMETER :: N = 20
  INTEGER, ALLOCATABLE, DIMENSION(:) :: my1DPtr
  INTEGER, DIMENSION(N) :: my1DArr

  allocate(my1DPtr(N))

  !$omp target enter data map(alloc: my1DPtr(:))
  !$omp target exit data map(delete: my1DPtr(:))

  my1DPtr(:) = 10
  my1DArr = 42
  print *, my1DArr  ! = 42, okay
  print *, my1DPtr  ! = 10, okay

  !$omp target map(from: my1DArr) map(tofrom: my1DPtr(:))
    my1DArr = my1DPtr
    my1DPtr(:) = 20
  !$omp end target

  print *, my1DArr ! should be: 10 (not 0 or 20+garbage)
  print *, my1DPtr ! should be: 20 (and not 10)
END

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

end of thread, other threads:[~2020-05-19  8:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 11:31 [Bug libgomp/94635] New: [OpenMP][Offloading] mapping with alloc/delete followed by map(from/fromto fails burnus at gcc dot gnu.org
2020-04-17 11:41 ` [Bug libgomp/94635] [OpenMP][Offloading] mapping with alloc/delete followed by map(from/tofrom:) fails burnus at gcc dot gnu.org
2020-04-17 15:13 ` [Bug middle-end/94635] " burnus at gcc dot gnu.org
2020-04-17 17:09 ` cvs-commit at gcc dot gnu.org
2020-04-17 19:06 ` burnus at gcc dot gnu.org
2020-04-20 21:21 ` cvs-commit at gcc dot gnu.org
2020-05-15  9:54 ` cvs-commit at gcc dot gnu.org
2020-05-19  8:12 ` cvs-commit 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).