]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
'libgomp.c/interop-hsa.c': GCN offloading only
authorThomas Schwinge <tschwinge@baylibre.com>
Mon, 5 May 2025 08:19:30 +0000 (10:19 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Mon, 5 May 2025 08:39:12 +0000 (10:39 +0200)
Fix-up for commit 8d84ea28510054fbbb8a2b7441916bd75e29163f
"OpenMP, GCN: Add interop-hsa testcase", which added 'libgomp.c/interop-hsa.c'.
If nvptx offloading compilation is enabled in addition to GCN, the former ICEs:

    during RTL pass: final
    [...]/libgomp.c/interop-hsa.c: In function 'get_kernel_ptr':
    [...]/libgomp.c/interop-hsa.c:34:1: internal compiler error: RTL check: expected code 'subreg', have 'reg' in nvptx_print_operand, at config/nvptx/nvptx.cc:3082
    0x1ccdb96 internal_error(char const*, ...)
            [...]/gcc/diagnostic-global-context.cc:517
    0x7446c3 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int, char const*)
            [...]/gcc/rtl.cc:770
    0x7fa533 nvptx_print_operand
            [...]/gcc/config/nvptx/nvptx.cc:3082
    0xb25f34 output_operand(rtx_def*, int)
            [...]/gcc/final.cc:3641
    0xb26f07 output_asm_insn(char const*, rtx_def**)
            [...]/gcc/final.cc:3534
    0xb29d91 output_asm_insn(char const*, rtx_def**)
            [...]/gcc/final.cc:2639
    0xb29d91 final_scan_insn_1
            [...]/gcc/final.cc:2642
    0xb2a59f final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
            [...]/gcc/final.cc:2892
    0xb2a68c final_1
            [...]/gcc/final.cc:1983
    0xb2b378 rest_of_handle_final
            [...]/gcc/final.cc:4250
    0xb2b378 execute
            [...]/gcc/final.cc:4328

Regardless of the issue that nvptx offloading compilation probably shouldn't
ICE, the 'asm' insert clearly is valid for GCN only.

libgomp/
* testsuite/libgomp.c/interop-hsa.c: GCN offloading only.

libgomp/testsuite/libgomp.c/interop-hsa.c

index cf8bc90bb9c07df7f4d249e5850780c14f7ab4f7..21ac91c1b58cfbc084dda6e39e5b18cedd555b19 100644 (file)
@@ -1,5 +1,7 @@
 /* { dg-additional-options "-ldl" } */
-/* { dg-require-effective-target offload_device_gcn } */
+/* { dg-require-effective-target offload_device_gcn }
+   The 'asm' insert is valid for GCN only:
+   { dg-additional-options -foffload=amdgcn-amdhsa } */
 
 #include <stdio.h>
 #include <stdlib.h>