]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
GCN: Remove 'last_arg' spec function
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 22 Nov 2023 14:39:50 +0000 (15:39 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Mon, 27 Nov 2023 14:54:35 +0000 (15:54 +0100)
The LLVM 13.0.1 assembler ('llvm-mc') indeed still does complain in presence of
multiple '-mcpu=[...]' options:

    as: for the --mcpu option: may only occur zero or one times!

However, as of
"GCN: Tag '-march=[...]', '-mtune=[...]' as 'Negative' of themselves [PR112669]",
the GCC-side special handling is no longer necessary.

gcc/
* config.gcc <amdgcn-*-amdhsa> (extra_gcc_objs): Don't set.
* config/gcn/driver-gcn.cc: Remove.
* config/gcn/gcn-hsa.h (ASM_SPEC, EXTRA_SPEC_FUNCTIONS): Remove
'last_arg' spec function.
* config/gcn/t-gcn-hsa (driver-gcn.o): Remove.

gcc/config.gcc
gcc/config/gcn/driver-gcn.cc [deleted file]
gcc/config/gcn/gcn-hsa.h
gcc/config/gcn/t-gcn-hsa

index e62849c12307bcb059944473536e3cd6fef22592..748430194f3e79c6f87cf9839031b9deabab343f 100644 (file)
@@ -1770,7 +1770,6 @@ amdgcn-*-amdhsa)
        native_system_header_dir=/include
        extra_modes=gcn/gcn-modes.def
        extra_objs="${extra_objs} gcn-tree.o"
-       extra_gcc_objs="driver-gcn.o"
        case "$host" in
        x86_64*-*-linux-gnu )
                if test "$ac_cv_search_dlopen" != no; then
diff --git a/gcc/config/gcn/driver-gcn.cc b/gcc/config/gcn/driver-gcn.cc
deleted file mode 100644 (file)
index 837633a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Subroutines for the gcc driver.
-   Copyright (C) 2018-2023 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3.  If not see
-<http://www.gnu.org/licenses/>.  */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
-const char *
-last_arg_spec_function (int argc, const char **argv)
-{
-  if (argc == 0)
-    return NULL;
-
-  return argv[argc-1];
-}
index aa1294cf48fdba73e00152a02bfd6db19e699708..4d72299da9b77a34900b75f373d4cf1c46ab5044 100644 (file)
@@ -88,7 +88,7 @@ extern unsigned int gcn_local_sym_hash (const char *name);
 
 /* Use LLVM assembler and linker options.  */
 #define ASM_SPEC  "-triple=amdgcn--amdhsa "  \
-                 "%:last_arg(%{march=*:-mcpu=%*}) " \
+                 "%{march=*:-mcpu=%*} " \
                  "%{!march=*|march=fiji:--amdhsa-code-object-version=3} " \
                  "%{" NO_XNACK XNACKOPT "}" \
                  "%{" NO_SRAM_ECC SRAMOPT "} " \
@@ -102,12 +102,6 @@ extern unsigned int gcn_local_sym_hash (const char *name);
 #define ENDFILE_SPEC   ""
 #define STANDARD_STARTFILE_PREFIX_2 ""
 
-/* The LLVM assembler rejects multiple -mcpu options, so we must drop
-   all but the last.  */
-extern const char *last_arg_spec_function (int argc, const char **argv);
-#define EXTRA_SPEC_FUNCTIONS   \
-    { "last_arg", last_arg_spec_function },
-
 #undef LOCAL_INCLUDE_DIR
 
 /* FIXME: Review debug info settings.
index 18db70753568dd8f344ee8c8c642da2c8a24f0fe..e2aec71b16194ceeae4a7c318b060e928e67ea47 100644 (file)
 
 GTM_H += $(HASH_TABLE_H)
 
-driver-gcn.o: $(srcdir)/config/gcn/driver-gcn.cc
-       $(COMPILE) $<
-       $(POSTCOMPILE)
-
 CFLAGS-mkoffload.o += $(DRIVER_DEFINES) \
        -DGCC_INSTALL_NAME=\"$(GCC_INSTALL_NAME)\"
 mkoffload.o: $(srcdir)/config/gcn/mkoffload.cc