]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[nvptx] Set -misa=sm_35 by default
authorTom de Vries <tdevries@suse.de>
Fri, 9 Oct 2020 09:36:10 +0000 (11:36 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 16 Feb 2021 16:47:49 +0000 (17:47 +0100)
The nvptx-as assembler verifies the ptx code using ptxas, if there's any
in the PATH.

The default in the nvptx port for -misa=sm_xx is sm_30, but the ptxas of the
latest cuda release (11.1) no longer supports sm_30.

Consequently we cannot build gcc against that release (although we should
still be able to build without any cuda release).

Fix this by setting -misa=sm_35 by default.

Tested check-gcc on nvptx.

Tested libgomp on x86_64-linux with nvpx accelerator.

Both build again cuda 9.1.

gcc/ChangeLog:

2020-10-09  Tom de Vries  <tdevries@suse.de>

PR target/97348
* config/nvptx/nvptx.h (ASM_SPEC): Also pass -m to nvptx-as if
default is used.
* config/nvptx/nvptx.opt (misa): Init with PTX_ISA_SM35.

(cherry picked from commit 383400a6078d75bbfa1216c9af2c37f7e88740c9)

gcc/ChangeLog.omp
gcc/config/nvptx/nvptx.h
gcc/config/nvptx/nvptx.opt

index 029e13d18552aa8644f32a459a2d0db45d9b765d..96896146824d1f809c96e5e91276ce299127243b 100644 (file)
@@ -1,3 +1,10 @@
+2021-02-16  Tom de Vries  <tdevries@suse.de>
+
+       PR target/97348
+       * config/nvptx/nvptx.h (ASM_SPEC): Also pass -m to nvptx-as if
+       default is used.
+       * config/nvptx/nvptx.opt (misa): Init with PTX_ISA_SM35.
+
 2021-02-09  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        Backport from mainline
index 6ebcc760771473834aea8e68a3c5ab9e583c66aa..17fe157058c115aba0fedee611e240cd2a82a142 100644 (file)
 
 #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
 
-#define ASM_SPEC "%{misa=*:-m %*}"
+/* Default needs to be in sync with default for misa in nvptx.opt.
+   We add a default here to work around a hard-coded sm_30 default in
+   nvptx-as.  */
+#define ASM_SPEC "%{misa=*:-m %*; :-m sm_35}"
 
 #define TARGET_CPU_CPP_BUILTINS()              \
   do                                           \
index 75c3d54864e9f79306bfedd80c5d81d4d25e8933..d6910a96cf09b66666315af0e3bdce2cb126c56f 100644 (file)
@@ -59,6 +59,7 @@ Enum(ptx_isa) String(sm_30) Value(PTX_ISA_SM30)
 EnumValue
 Enum(ptx_isa) String(sm_35) Value(PTX_ISA_SM35)
 
+; Default needs to be in sync with default in ASM_SPEC in nvptx.h.
 misa=
-Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM30)
+Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM35)
 Specify the version of the ptx ISA to use.