On Wed, 21 Apr 2021, Tobias Burnus wrote:

> This was brought up by Richard when testing libgomp with the GCC 11
> distribution
> compiler, which has both nvptx and gcn enabled – but no offloading device was
> available.
> 
> This lead to fails for:
> * testsuite/libgomp.c-c++-common/function-not-offloaded.c:
>   → function (on purpose) not marked for offline
>   → issue: dg-excess-errors by lto1/mkoffload not ignored
> * testsuite/libgomp.c-c++-common/variable-not-offloaded.c
>   → likewise for variables, except that this would succeed
>   with unified-shared memory
>   → issue: dg-excess-errors by lto1/mkoffload not ignored
> * libgomp/testsuite/libgomp.c/pr86416-1.c + *-2.c
>   → expected fail when offloading compiler does not support
>   long double or float128
>   → issue: error output but dg-error/dg-excess-error not active
> 
> The reason for those fails is that used effective target checks
> do not cover those cases correctly. Namely:
> 
> * offload_device - check whether an offloading device is
>   available & used at run time.
>   → problem: compilation was done for the device but here
>   no device is available
> * offload_device_nonshared_as
>   → Likewise and same issue, except that also 0 is returned
>   if the device has unified shared memory.
> 
> Solution: Explicitly check for nvptx/gcn offload compilation
> (but ignore device availability).
> [Uses 'gcc -v |grep ^OFFLOAD_TARGET_NAMES=', which honors
> -foffload=, including -foffload=disable.]
> 
> OK for mainline and GCC 11?
> 
> 
> Tested without offloading support & with nvptx &
> offload support (with an offloading device available).
> 
> @Richard: I would be happy if you could confirm that this fixes
> your issue.

So with this I'm down to

                === libgomp tests ===


Running target unix
XPASS: libgomp.c/../libgomp.c-c++-common/pr96390.c (test for excess 
errors)
FAIL: libgomp.c/target-28.c (test for excess errors)
UNRESOLVED: libgomp.c/target-28.c compilation failed to produce executable
XPASS: libgomp.c++/../libgomp.c-c++-common/pr96390.c (test for excess 
errors)
XPASS: libgomp.c++/pr96390.C (test for excess errors)
FAIL: libgomp.c++/target-13.C (test for excess errors)
UNRESOLVED: libgomp.c++/target-13.C compilation failed to produce 
executable

                === libgomp Summary ===

# of expected passes            8411
# of unexpected failures        2
# of unexpected successes       3

which is nice.  The target-28.c FAIL is

spawn -ignore SIGHUP 
/home/abuild/rpmbuild/BUILD/gcc-11.0.1+git10/obj-x86_64-suse-linux/./gcc/xgcc 
-B/home/abuild/rpmbuild/BUILD/gcc-11.0.1+git10/obj-x86_64-suse-linux/./gcc/ 
-B/usr/x86_64-suse-linux/bin/ -B/usr/x86_64-suse-linux/lib/ -isystem 
/usr/x86_64-suse-linux/include -isystem /usr/x86_64-suse-linux/sys-include 
-fchecking=1 ../../../../libgomp/testsuite/libgomp.c/target-28.c 
-B/home/abuild/rpmbuild/BUILD/gcc-11.0.1+git10/obj-x86_64-suse-linux/x86_64-suse-linux/./libgomp/
 
-B/home/abuild/rpmbuild/BUILD/gcc-11.0.1+git10/obj-x86_64-suse-linux/x86_64-suse-linux/./libgomp/.libs
 
-I/home/abuild/rpmbuild/BUILD/gcc-11.0.1+git10/obj-x86_64-suse-linux/x86_64-suse-linux/./libgomp
 
-I../../../../libgomp/testsuite/../../include 
-I../../../../libgomp/testsuite/.. -Lno -fmessage-length=0 
-fno-diagnostics-show-caret -fdiagnostics-color=never 
-B/usr/lib64/gcc/x86_64-suse-linux/11 -B/usr/bin 
-B/usr/lib64/gcc/x86_64-suse-linux/11 -B/usr/bin -fopenmp -O2 
-L/home/abuild/rpmbuild/BUILD/gcc-11.0.1+git10/obj-x86_64-suse-linux/x86_64-suse-linux/./libgomp/.libs
 
-lm -o ./target-28.exe^M
^[[1m/tmp/ccCLBCvn.mkoffload.2.s:233:2: ^[[0m^[[0;1;31merror: 
^[[0m^[[1ms.3 changed binding to STB_GLOBAL^M
^[[0m        .global s.3^M
^[[0;1;32m        ^^M
^[[0m^[[1m/tmp/ccCLBCvn.mkoffload.2.s:234:2: ^[[0m^[[0;1;31merror: 
^[[0m^[[1ms.2 changed binding to STB_GLOBAL^M
^[[0m        .global s.2^M
^[[0;1;32m        ^^M
^[[0mmkoffload: fatal error: 
/usr/bin//x86_64-suse-linux-accel-amdgcn-amdhsa-gcc-11 returned 1 exit 
status^M
compilation terminated.^M
lto-wrapper: fatal error: 
/usr/lib64/gcc/x86_64-suse-linux/11//accel/amdgcn-amdhsa/mkoffload 
returned 1 exit status^M

and the target-13.C one is similar.

Richard.

Reply via email to