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

            Bug ID: 120194
           Summary: USM offloading vs. 'libgomp.c++/declare_target-1.C'
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: testsuite-fail, wrong-code
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: tschwinge at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org, jakub at gcc dot gnu.org
  Target Milestone: ---

If in 'libgomp.c++/declare_target-1.C', I replace 'dg-require-effective-target
offload_device_shared_as' with '#pragma omp requires unified_shared_memory'
(and run that on a suitable device), the execution test FAILs.  (XFAILed test
case soon to appear.)

In '-fdump-tree-gimple', we've got 'map(tofrom:varY [len: 4]
[runtime_implicit]) map(tofrom:varX [len: 4] [runtime_implicit])', which looks
expected.  But, despite 'unified_shared_memory' being if effect, libgomp still
maps 'varX', 'varY' (verified: I see different addresses from host addresses),
and after the OpenMP 'target', their 'a' members are set to '0' instead of
'100'.  The issue disappears if I remove '#pragma omp declare target' for
'varX', 'varY', so I suspect that (global mapping setup;
'gomp_load_image_to_device'?) is where the problem originates.

I'll have a look.

Reply via email to