public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7933] [nvptx] Fix ASM_SPEC workaround for sm_30
@ 2022-03-31  7:38 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-03-31  7:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:bf4832d6fa817f66009f100a9cd68953062add7d

commit r12-7933-gbf4832d6fa817f66009f100a9cd68953062add7d
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Mar 30 13:26:52 2022 +0200

    [nvptx] Fix ASM_SPEC workaround for sm_30
    
    Newer versions of CUDA no longer support sm_30, and nvptx-tools as
    currently doesn't handle that gracefully when verifying
    ( https://github.com/MentorEmbedded/nvptx-tools/issues/30 ).
    
    There's a --no-verify work-around in place in ASM_SPEC, but that one doesn't
    work when using -Wa,--verify on the command line.
    
    Use a more robust workaround: verify using sm_35 when misa=sm_30 is specified
    (either implicitly or explicitly).
    
    Tested on nvptx.
    
    gcc/ChangeLog:
    
    2022-03-30  Tom de Vries  <tdevries@suse.de>
    
            * config/nvptx/nvptx.h (ASM_SPEC): Use "-m sm_35" for -misa=sm_30.

Diff:
---
 gcc/config/nvptx/nvptx.h | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 75ac7a666b1..3b06f33032f 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -29,10 +29,24 @@
 
 #define STARTFILE_SPEC "%{mmainkernel:crt0.o}"
 
-/* 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}%{misa=sm_30:--no-verify}"
+/* Newer versions of CUDA no longer support sm_30, and nvptx-tools as
+   currently doesn't handle that gracefully when verifying
+   ( https://github.com/MentorEmbedded/nvptx-tools/issues/30 ).  Work around
+   this by verifying with sm_35 when having misa=sm_30 (either implicitly
+   or explicitly).  */
+#define ASM_SPEC				\
+  "%{"						\
+  /* Explict misa=sm_30.  */			\
+  "misa=sm_30:-m sm_35"				\
+  /* Separator.	 */				\
+  "; "						\
+  /* Catch-all.	 */				\
+  "misa=*:-m %*"				\
+  /* Separator.	 */				\
+  "; "						\
+  /* Implicit misa=sm_30.  */			\
+  ":-m sm_35"					\
+  "}"
 
 #define TARGET_CPU_CPP_BUILTINS() nvptx_cpu_cpp_builtins ()


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-31  7:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31  7:38 [gcc r12-7933] [nvptx] Fix ASM_SPEC workaround for sm_30 Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).