https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97348

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |nvptx

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Using this:
...
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 75c3d54864e..4c27a832d28 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -60,5 +60,5 @@ EnumValue
 Enum(ptx_isa) String(sm_35) Value(PTX_ISA_SM35)

 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.
...
and rebuilding cc1, we indeed get the sm_35 in the .s file.

However, when doing a complete rebuild against system cuda, we run into this in
configure doing a conftest:
...
ptxas fatal   : SM version specified by .target is higher than default SM
version assumed
nvptx-as: ptxas returned 255 exit status
...

If we add -misa=sm_35 to the command line, the conftest passes.

Looking in the nvptx-as sources, we find a hard_coded default:
...
  const char *smver = "sm_30";
...
and after changing that to sm_35, the conftest passes.

I'm not sure if nvptx-as should have a hardcoded default, probably it should
parse the .target line and pass that to ptxas.

Reply via email to