On Wed, Apr 29, 2020 at 5:05 PM Tobias Burnus <tob...@codesourcery.com> wrote: > > Hi Thomas, > > was a bit on the backburner but I now digged again. > See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94848 > > The problem is a generated static array variable in the > device function: > static integer(kind=4) A.12[3] = {1, 2, 3}; > used as > _26 = A.12[S.13_67]; > > With -ftree-pre, the expressions using _26 now directly use > the value (1, 2 and 3). It seems as if the variable A.12 is > eliminated before writing to LTO but the usage (A.12[S.…]) > is not – at least it still appears in the device dumps. > > Maybe it is also related to something else, but crucial is > the -ftree-pre on the host side; the optimization level on > the device lto1 side is irrelevant.
IIRC there was a bugreport similar to this where offload variables were computed "early" instead of at the point of streaming. It's obvious that the offload "part" use is not reflected in the non-offloat "part" IL (like via a function call parameter or so), so I assume this is a local static in a function we simply compile twice (but did not actually clone), once for each offloat target and once for the host. So it's likely the above issue. Richard. > Cheers, > > Tobias > > On 4/29/20 12:00 PM, Thomas Schwinge wrote: > > > Hi Tobias! > > > > Do you happen to have any update regarding this one: > > > > On 2020-01-08T09:55:06+0100, Tobias Burnus <tob...@codesourcery.com> wrote: > >> On 1/8/20 9:33 AM, Thomas Schwinge wrote: > >>> With 'dg-do run' added, on [...] x86_64-pc-linux-gnu with offloading I'm > >>> seeing: > > | PASS: libgomp.fortran/use_device_ptr-optional-3.f90 -O0 (test for > > excess errors) > > | PASS: libgomp.fortran/use_device_ptr-optional-3.f90 -O0 execution > > test > > | PASS: libgomp.fortran/use_device_ptr-optional-3.f90 -O1 (test for > > excess errors) > > | PASS: libgomp.fortran/use_device_ptr-optional-3.f90 -O1 execution > > test > > | FAIL: libgomp.fortran/use_device_ptr-optional-3.f90 -O2 (test for > > excess errors) > > | UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90 -O2 > > compilation failed to produce executable > > | FAIL: libgomp.fortran/use_device_ptr-optional-3.f90 -O3 > > -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer > > -finline-functions (test for excess errors) > > | UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90 -O3 > > -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer > > -finline-functions compilation failed to produce executable > > | FAIL: libgomp.fortran/use_device_ptr-optional-3.f90 -O3 -g (test > > for excess errors) > > | UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90 -O3 -g > > compilation failed to produce executable > > | FAIL: libgomp.fortran/use_device_ptr-optional-3.f90 -Os (test for > > excess errors) > > | UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90 -Os > > compilation failed to produce executable > > > >>> ... due to: > >>> /tmp/cciVc43I.o:(.gnu.offload_vars+0x10): undefined reference to > >>> `A.12.4064' > >>> which may be something like PR90779, PR85063, PR84592, PR90779, > >>> PR80411, PR71536 -- or something else. > >> Hmm. It is surely among the listed items, if all fails in the last item. > >> Note that PR85063 is fixed and PR84592 a duplicate of PR90779 (which is > >> listed twice). To through in another number it could also be a variant > >> of PR 92029 to though in yet another number … > > > > Grüße > > Thomas > > ----------------- > > Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / > > Germany > > Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, > > Alexander Walter > ----------------- > Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany > Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, > Alexander Walter