https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127213
Bug ID: 127213
Summary: [OpenMP] 'requires self_map/USM' leads to wrong code
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: openmp, wrong-code
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Target Milestone: ---
Created attachment 65498
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65498&action=edit
Testcase - compile with "gcc -fopenmp" and w/ and w/o "-DUSE_SELF_MAPS"
The following program works with:
- host fallback
- running on the device with copying data to the device
- with self mapping via GOMP_RUNTIME_USM=enabled
With the latter, the output is the following, but all look similar:
6
7
8
device self map - 0x4ae050 / 0x7f3da1000000
8
9
10
device self map - 0x4ae050 / 0x7f3da1000000
However, with 'omp requires self_maps' it fails:
5
6
6
device self map - 0x4ae070 / 0x7f86d1000000
<aborted>
EXPECTED:
* Code actually works
* The address is the same as: 'all corresponding list items created by the
enter clauses specified by declare target directives in the compilation unit
share storage with the original list items'