diff mbox

SWITCH_TAKES_ARG etc. cleanup

Message ID Pine.LNX.4.64.1010242127090.32646@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers Oct. 24, 2010, 9:28 p.m. UTC
I noted in <http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02027.html>
that SWITCH_TAKES_ARG and WORD_SWITCH_TAKES_ARG now only need to
handle options that are *not* included in .opt files (such options
should eventually go away altogether, with all options GCC accepts
being in .opt files).  This patch starts the consequential cleanup of
these macros - including the complete removal of SWITCH_TAKES_ARG.

Simply removing options known to .opt files allows a lot of cases in
these macros to go away - including all cases in the default
definitions except for -T, -Tbss, -Tdata, -Ttext.  Naively removing
such cases, and definitions with no cases left, may not however be
safe.  If a definition in one target header is removed, it may turn
out that said definition was overriding one in another target header
(such as svr4.h), which now becomes active, with possibly unintended
effects.

I failed to consider that issue when adding and removing
SWITCH_TAKES_ARG definitions for -G in
<http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00066.html>, and on
closer examination the existing semantics of which definitions are
present where does not reliably reflect any real logic about what
systems actually support what linker options.  (The problem cases are
all about linker options -R, -z, -h, -Tbss, -Tdata, -Ttext.)  Some
targets do deliberately override svr4.h - but that does not mean that
they lack its options or that they are the only targets using svr4.h
that lack them.  svr4.h overrides the default regarding -Tbss, -Tdata,
-Ttext - but plenty of targets using svr4.h do use the GNU linker
which does support those options (taking arguments).

My conclusion was that it was most appropriate to include all the
affected options - -R, -h, -z and the -T options - in common.opt
unconditionally.  This does *not* mean that GCC accepts them
everywhere; if there is no spec that uses a particular option, the
driver will still reject it.  It simply means that when GCC processes
its command line, it will always treat these options as having
arguments (and then still reject the option+argument if there is no
matching spec; note that %{z} in LINK_COMMAND_SPEC in gcc.c means -z
options are already accepted everywhere except Darwin, although the
linker may always reject them on some targets).  The case of -G is

Comments

Joseph Myers Nov. 1, 2010, 1:16 p.m. UTC | #1
Ping.  This patch 
<http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02102.html> and its followup 
<http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02373.html> are pending 
review.
Richard Biener Nov. 1, 2010, 10:17 p.m. UTC | #2
On Mon, Nov 1, 2010 at 2:16 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> Ping.  This patch
> <http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02102.html> and its followup
> <http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02373.html> are pending
> review.

They are both ok.

Thanks,
Richard.

> --
> Joseph S. Myers
> joseph@codesourcery.com
>
diff mbox

Patch

different since there some targets have a -G linker option without
argument.  The only possible case I could find of any of the above
options being expected without argument was %{R} in SPARC's ASM_SPEC,
but since -R is also used as a linker option for some SPARC targets I
don't think this spec could have done anything usefully, and it is
removed in this patch.

(I still think it would be appropriate, as I said in
<http://gcc.gnu.org/ml/gcc/2001-05/msg00282.html>, for -R to be a
machine-independent driver option for -rpath or an equivalent linker
option.  But I don't plan to implement this.)

Some specs would pass -x options to the linker - since -x is a driver
option to select a language, which gets handled and removed before
specs are handled, those are useless and removed in this patch.

I expect a followup patch to clean up all remaining target definitions
of WORD_SWITCH_TAKES_ARG except for the darwin.h definition's handling
of options taking two or more arguments (which will need new .opt
facilities to describe such options before it can go away).

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  Also
tested building cc1 and xgcc for crosses to: alpha-linux-gnu
i686-darwin fr30-elf i686-freebsd8.1 frv-elf i686-pc-msdosdjgpp
ia64-elf i686-interix3 lm32-elf m32r-elf microblaze-elf mips-elf
mips-netbsdelf mips-wrs-vxworks arm-netbsd i686-openbsd3 powerpc-eabi
score-elf i686-solaris2.10 sparc-elf sparc64-elf.  (The i686-interix3
build failed for unrelated reasons.)  OK to commit?

2010-10-24  Joseph Myers  <joseph@codesourcery.com>

	* common.opt (R, T, Tbss, Tdata, Ttext, h, z): New.
	* defaults.h (DEFAULT_SWITCH_TAKES_ARG, SWITCH_TAKES_ARG): Remove.
	(DEFAULT_WORD_SWITCH_TAKES_ARG): Define to 0.
	* doc/tm.texi.in (SWITCH_TAKES_ARG): Remove.
	(WORD_SWITCH_TAKES_ARG): Don't refer to SWITCH_TAKES_ARG.
	Document that options in .opt files do not need to be included.
	* doc/tm.texi: Regenerate.
	* gcc.c (LINK_COMMAND_SPEC): Don't include %{x}.
	* opts-common.c: Update comment on tm.h include.
	(decode_cmdline_option): Don't use SWITCH_TAKES_ARG.
	* system.h (SWITCH_TAKES_ARG): Poison.
	* config/alpha/alpha.h (SWITCH_TAKES_ARG): Remove.
	* config/darwin.h (WORD_SWITCH_TAKES_ARG): Remove options included
	in darwin.opt.
	(LINK_COMMAND_SPEC_A): Don't include %{x}.
	* config/fr30/fr30.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG):
	Remove.
	* config/freebsd-spec.h (FBSD_SWITCH_TAKES_ARG): Remove.
	* config/freebsd.h (SWITCH_TAKES_ARG): Remove.
	* config/frv/frv.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG):
	Remove.
	* config/i386/djgpp.h (LINK_COMMAND_SPEC): Don't include %{x}.
	* config/ia64/ia64.h (SWITCH_TAKES_ARG): Remove.
	* config/interix.h (WORD_SWITCH_TAKES_ARG): Don't handle -T
	options.
	* config/lm32/lm32.h (SWITCH_TAKES_ARG): Remove.
	* config/m32r/m32r.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG):
	Remove.
	* config/microblaze/microblaze.h (SWITCH_TAKES_ARG): Remove.
	* config/mips/mips.h (SWITCH_TAKES_ARG): Remove.
	* config/mips/netbsd.h (SWITCH_TAKES_ARG): Remove.
	* config/mips/vxworks.h (SWITCH_TAKES_ARG): Remove.
	* config/netbsd-aout.h (SWITCH_TAKES_ARG): Remove.
	* config/netbsd-elf.h (SWITCH_TAKES_ARG): Remove.
	* config/openbsd.h (SWITCH_TAKES_ARG): Remove.
	* config/rs6000/sysv4.h (SWITCH_TAKES_ARG): Remove.
	* config/score/score.h (SWITCH_TAKES_ARG): Remove.
	* config/sol2.h (SWITCH_TAKES_ARG): Remove.
	* config/sparc/sp-elf.h (SWITCH_TAKES_ARG): Remove.
	* config/sparc/sp64-elf.h (SWITCH_TAKES_ARG): Remove.
	* config/sparc/sparc.h (ASM_SPEC): Don't include %{R}.
	* config/svr4.h (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG): Remove.

Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi	(revision 165891)
+++ gcc/doc/tm.texi	(working copy)
@@ -99,24 +99,12 @@  from being defined in the @file{.h} file
 @c prevent bad page break with this line
 You can control the compilation driver.
 
-@defmac SWITCH_TAKES_ARG (@var{char})
-A C expression which determines whether the option @option{-@var{char}}
-takes arguments.  The value should be the number of arguments that
-option takes--zero, for many options.
-
-By default, this macro is defined as
-@code{DEFAULT_SWITCH_TAKES_ARG}, which handles the standard options
-properly.  You need not define @code{SWITCH_TAKES_ARG} unless you
-wish to add additional options which take arguments.  Any redefinition
-should call @code{DEFAULT_SWITCH_TAKES_ARG} and then check for
-additional options.
-@end defmac
-
 @defmac WORD_SWITCH_TAKES_ARG (@var{name})
 A C expression which determines whether the option @option{-@var{name}}
 takes arguments.  The value should be the number of arguments that
-option takes--zero, for many options.  This macro rather than
-@code{SWITCH_TAKES_ARG} is used for multi-character option names.
+option takes--zero, for many options.
+This macro does not need to handle options defined in @file{.opt}
+files, only those that are handled purely through specs.
 
 By default, this macro is defined as
 @code{DEFAULT_WORD_SWITCH_TAKES_ARG}, which handles the standard options
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in	(revision 165891)
+++ gcc/doc/tm.texi.in	(working copy)
@@ -99,24 +99,12 @@  from being defined in the @file{.h} file
 @c prevent bad page break with this line
 You can control the compilation driver.
 
-@defmac SWITCH_TAKES_ARG (@var{char})
-A C expression which determines whether the option @option{-@var{char}}
-takes arguments.  The value should be the number of arguments that
-option takes--zero, for many options.
-
-By default, this macro is defined as
-@code{DEFAULT_SWITCH_TAKES_ARG}, which handles the standard options
-properly.  You need not define @code{SWITCH_TAKES_ARG} unless you
-wish to add additional options which take arguments.  Any redefinition
-should call @code{DEFAULT_SWITCH_TAKES_ARG} and then check for
-additional options.
-@end defmac
-
 @defmac WORD_SWITCH_TAKES_ARG (@var{name})
 A C expression which determines whether the option @option{-@var{name}}
 takes arguments.  The value should be the number of arguments that
-option takes--zero, for many options.  This macro rather than
-@code{SWITCH_TAKES_ARG} is used for multi-character option names.
+option takes--zero, for many options.
+This macro does not need to handle options defined in @file{.opt}
+files, only those that are handled purely through specs.
 
 By default, this macro is defined as
 @code{DEFAULT_WORD_SWITCH_TAKES_ARG}, which handles the standard options
Index: gcc/opts-common.c
===================================================================
--- gcc/opts-common.c	(revision 165891)
+++ gcc/opts-common.c	(working copy)
@@ -24,7 +24,7 @@  along with GCC; see the file COPYING3.  
 #include "opts.h"
 #include "flags.h"
 #include "diagnostic.h"
-#include "tm.h" /* For SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG and
+#include "tm.h" /* For WORD_SWITCH_TAKES_ARG and
 		   TARGET_OPTION_TRANSLATE_TABLE.  */
 
 static void prune_options (struct cl_decoded_option **, unsigned int *);
@@ -507,13 +507,10 @@  decode_cmdline_option (const char **argv
     {
       /* Skip the correct number of arguments for options handled
 	 through specs.  */
-      const char *popt = argv[0] + 1;
-      int c = *popt;
+      const char *popt ATTRIBUTE_UNUSED = argv[0] + 1;
 
       gcc_assert (result == 1);
-      if (SWITCH_TAKES_ARG (c) > (popt[1] != 0))
-	result += SWITCH_TAKES_ARG (c) - (popt[1] != 0);
-      else if (WORD_SWITCH_TAKES_ARG (popt))
+      if (WORD_SWITCH_TAKES_ARG (popt))
 	result += WORD_SWITCH_TAKES_ARG (popt);
       if (result > 1)
 	for (i = 1; i < result; i++)
Index: gcc/defaults.h
===================================================================
--- gcc/defaults.h	(revision 165891)
+++ gcc/defaults.h	(working copy)
@@ -32,33 +32,9 @@  see the files COPYING3 and COPYING.RUNTI
 #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
 #endif
 
-/* This defines which switch letters take arguments.  */
-
-#define DEFAULT_SWITCH_TAKES_ARG(CHAR) \
-  ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
-   || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
-   || (CHAR) == 'I' || (CHAR) == 'J' || (CHAR) == 'm' \
-   || (CHAR) == 'x' || (CHAR) == 'L' || (CHAR) == 'A' \
-   || (CHAR) == 'B' || (CHAR) == 'd')
-
 /* This defines which multi-letter switches take arguments.  */
 
-#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR)		\
- (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext")	\
-  || !strcmp (STR, "Tbss") || !strcmp (STR, "include")	\
-  || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
-  || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
-  || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
-  || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \
-  || !strcmp (STR, "isysroot") || !strcmp (STR, "imultilib") \
-  || !strcmp (STR, "-param") || !strcmp (STR, "specs") \
-  || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ") \
-  || !strcmp (STR, "fintrinsic-modules-path") \
-  || !strcmp (STR, "dumpbase") || !strcmp (STR, "dumpdir"))
-
-#ifndef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG (CHAR)
-#endif
+#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR)		0
 
 #ifndef WORD_SWITCH_TAKES_ARG
 #define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c	(revision 165891)
+++ gcc/gcc.c	(working copy)
@@ -665,7 +665,7 @@  proper position among the other output f
     %{flto:%<fcompare-debug*} %{fwhopr*:%<fcompare-debug*} \
     %{flto} %{fwhopr*} %l " LINK_PIE_SPEC \
    "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
-    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
+    %{s} %{t} %{u*} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
     %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\
     %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
     %(mflib) " STACK_SPLIT_SPEC "\
Index: gcc/common.opt
===================================================================
--- gcc/common.opt	(revision 165891)
+++ gcc/common.opt	(working copy)
@@ -290,9 +290,24 @@  Ofast
 Common Optimization
 Optimize for speed disregarding exact standards compliance
 
+R
+Driver Joined Separate
+
 S
 Driver
 
+T
+Driver Joined Separate
+
+Tbss
+Driver Separate
+
+Tdata
+Driver Separate
+
+Ttext
+Driver Separate
+
 W
 Common RejectNegative Warning Alias(Wextra)
 This switch is deprecated; use -Wextra instead
@@ -1885,6 +1900,9 @@  gxcoff+
 Common JoinedOrMissing Negative(gcoff)
 Generate debug information in extended XCOFF format
 
+h
+Driver Joined Separate
+
 iplugindir=
 Common Joined Var(plugindir_string) Init(0)
 -iplugindir=<dir>	Set <dir> to be the default plugin directory
@@ -2026,4 +2044,7 @@  pie
 Common RejectNegative Negative(shared)
 Create a position independent executable
 
+z
+Driver Joined Separate
+
 ; This comment is to ensure we retain the blank line above.
Index: gcc/system.h
===================================================================
--- gcc/system.h	(revision 165891)
+++ gcc/system.h	(working copy)
@@ -776,7 +776,7 @@  extern void fancy_abort (const char *, i
 	STACK_CHECK_PROBE_INTERVAL STACK_CHECK_PROBE_LOAD		   \
 	ORDER_REGS_FOR_LOCAL_ALLOC FUNCTION_OUTGOING_VALUE		   \
 	ASM_DECLARE_CONSTANT_NAME MODIFY_TARGET_NAME SWITCHES_NEED_SPACES  \
-	SWITCH_CURTAILS_COMPILATION
+	SWITCH_CURTAILS_COMPILATION SWITCH_TAKES_ARG
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
Index: gcc/config/alpha/alpha.h
===================================================================
--- gcc/config/alpha/alpha.h	(revision 165891)
+++ gcc/config/alpha/alpha.h	(working copy)
@@ -96,9 +96,6 @@  along with GCC; see the file COPYING3.  
   while (0)
 #endif
 
-#define SWITCH_TAKES_ARG(CHAR)						\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 #define WORD_SWITCH_TAKES_ARG(STR)		\
  (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
 
Index: gcc/config/frv/frv.h
===================================================================
--- gcc/config/frv/frv.h	(revision 165891)
+++ gcc/config/frv/frv.h	(working copy)
@@ -35,33 +35,6 @@ 
 
 /* Driver configuration.  */
 
-/* A C expression which determines whether the option `-CHAR' takes arguments.
-   The value should be the number of arguments that option takes-zero, for many
-   options.
-
-   By default, this macro is defined to handle the standard options properly.
-   You need not define it unless you wish to add additional options which take
-   arguments.
-
-   Defined in svr4.h.  */
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)                                          \
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
-/* A C expression which determines whether the option `-NAME' takes arguments.
-   The value should be the number of arguments that option takes-zero, for many
-   options.  This macro rather than `SWITCH_TAKES_ARG' is used for
-   multi-character option names.
-
-   By default, this macro is defined as `DEFAULT_WORD_SWITCH_TAKES_ARG', which
-   handles the standard options properly.  You need not define
-   `WORD_SWITCH_TAKES_ARG' unless you wish to add additional options which take
-   arguments.  Any redefinition should call `DEFAULT_WORD_SWITCH_TAKES_ARG' and
-   then check for additional options.
-
-   Defined in svr4.h.  */
-#undef WORD_SWITCH_TAKES_ARG
-
 /* -fpic and -fPIC used to imply the -mlibrary-pic multilib, but with
     FDPIC which multilib to use depends on whether FDPIC is in use or
     not.  The trick we use is to introduce -multilib-library-pic as a
Index: gcc/config/interix.h
===================================================================
--- gcc/config/interix.h	(revision 165891)
+++ gcc/config/interix.h	(working copy)
@@ -1,6 +1,6 @@ 
 /* Operating system specific defines to be used when targeting GCC for
    Interix
-   Copyright (C) 1994, 1995, 1999, 2002, 2004, 2007
+   Copyright (C) 1994, 1995, 1999, 2002, 2004, 2007, 2010
    Free Software Foundation, Inc.
    Donn Terry, Softway Systems, Inc. (donn@softway.com)
    Modified from code
@@ -59,11 +59,9 @@  for windows/multi thread */
   "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}} %{shared:crti%O%s}"
 
 #undef WORD_SWITCH_TAKES_ARG
-#define WORD_SWITCH_TAKES_ARG(STR)					\
- ((DEFAULT_WORD_SWITCH_TAKES_ARG (STR)					\
- || !strcmp(STR, "rpath"))						\
-  && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")			\
-  && strcmp (STR, "Tbss"))
+#define WORD_SWITCH_TAKES_ARG(STR)		\
+ (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)		\
+  || !strcmp(STR, "rpath"))
 
 
 #define STDC_0_IN_SYSTEM_HEADERS 1
Index: gcc/config/sparc/sp64-elf.h
===================================================================
--- gcc/config/sparc/sp64-elf.h	(revision 165891)
+++ gcc/config/sparc/sp64-elf.h	(working copy)
@@ -1,5 +1,5 @@ 
 /* Definitions of target machine for GCC, for SPARC64, ELF.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2004, 2005, 2007
+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2004, 2005, 2007, 2010
    Free Software Foundation, Inc.
    Contributed by Doug Evans, dje@cygnus.com.
 
@@ -71,15 +71,6 @@  crtbegin.o%s \
 /* Use the default (for now).  */
 #undef LIB_SPEC
 
-/* This defines which switch letters take arguments.
-   It is as in svr4.h but with -R added.  */
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
-  (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
-   || (CHAR) == 'R' \
-   || (CHAR) == 'h' \
-   || (CHAR) == 'z')
-
 #undef BYTES_BIG_ENDIAN
 #define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)
 
Index: gcc/config/sparc/sp-elf.h
===================================================================
--- gcc/config/sparc/sp-elf.h	(revision 165891)
+++ gcc/config/sparc/sp-elf.h	(working copy)
@@ -1,6 +1,6 @@ 
 /* Definitions of target machine for GCC,
    for SPARC running in an embedded environment using the ELF file format.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -45,15 +45,6 @@  along with GCC; see the file COPYING3.  
 /* Don't set the target flags, this is done by the linker script */
 #undef LIB_SPEC
 #define LIB_SPEC ""
-
-/* This defines which switch letters take arguments.
-   It is as in svr4.h but with -R added.  */
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
-  (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
-   || (CHAR) == 'R' \
-   || (CHAR) == 'h' \
-   || (CHAR) == 'z')
 
 #undef  LOCAL_LABEL_PREFIX
 #define LOCAL_LABEL_PREFIX  "."
Index: gcc/config/sparc/sparc.h
===================================================================
--- gcc/config/sparc/sparc.h	(revision 165891)
+++ gcc/config/sparc/sparc.h	(working copy)
@@ -450,7 +450,7 @@  extern enum cmodel sparc_cmodel;
 /* Special flags to the Sun-4 assembler when using pipe for input.  */
 
 #define ASM_SPEC "\
-%{R} %{!pg:%{!p:%{fpic|fPIC|fpie|fPIE:-k}}} %{keep-local-as-symbols:-L} \
+%{!pg:%{!p:%{fpic|fPIC|fpie|fPIE:-k}}} %{keep-local-as-symbols:-L} \
 %(asm_cpu) %(asm_relax)"
 
 #define AS_NEEDS_DASH_FOR_PIPED_INPUT
Index: gcc/config/netbsd-aout.h
===================================================================
--- gcc/config/netbsd-aout.h	(revision 165891)
+++ gcc/config/netbsd-aout.h	(working copy)
@@ -1,5 +1,5 @@ 
 /* Common configuration file for NetBSD a.out targets.
-   Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
 This file is part of GCC.
@@ -26,13 +26,6 @@  along with GCC; see the file COPYING3.  
     }						\
   while (0)
 
-/* This defines which switch letters take arguments.  */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)		\
-  (DEFAULT_SWITCH_TAKES_ARG(CHAR)	\
-   || (CHAR) == 'R')
-
 
 /* Provide an ASM_SPEC appropriate for NetBSD.  Currently we only deal
    with the options for generating PIC code.  */
Index: gcc/config/m32r/m32r.h
===================================================================
--- gcc/config/m32r/m32r.h	(revision 165891)
+++ gcc/config/m32r/m32r.h	(working copy)
@@ -22,8 +22,6 @@ 
 - longlong.h?
 */
 
-#undef SWITCH_TAKES_ARG
-#undef WORD_SWITCH_TAKES_ARG
 #undef HANDLE_SYSV_PRAGMA
 #undef SIZE_TYPE
 #undef PTRDIFF_TYPE
@@ -94,12 +92,6 @@ 
 #define TARGET_VERSION fprintf (stderr, " (m32r)")
 #endif
 
-/* Switch  Recognition by gcc.c.  Add -G xx support.  */
-
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
-(DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 /* Names to predefine in the preprocessor for this target machine.  */
 /* __M32R__ is defined by the existing compiler so we use that.  */
 #define TARGET_CPU_CPP_BUILTINS()		\
Index: gcc/config/i386/djgpp.h
===================================================================
--- gcc/config/i386/djgpp.h	(revision 165891)
+++ gcc/config/i386/djgpp.h	(working copy)
@@ -102,7 +102,7 @@  along with GCC; see the file COPYING3.  
 #define LINK_COMMAND_SPEC \
 "%{!fsyntax-only: \
 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
-\t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
+\t%{r} %{s} %{t} %{u*} %{z} %{Z}\
 \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
 \t%{static:} %{L*} %D %o\
 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
Index: gcc/config/sol2.h
===================================================================
--- gcc/config/sol2.h	(revision 165891)
+++ gcc/config/sol2.h	(working copy)
@@ -192,15 +192,6 @@  along with GCC; see the file COPYING3.  
 #undef SUPPORTS_INIT_PRIORITY
 #define SUPPORTS_INIT_PRIORITY 0
 
-/* This defines which switch letters take arguments.
-   It is as in svr4.h but with -R added.  */
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
-  (DEFAULT_SWITCH_TAKES_ARG(CHAR) \
-   || (CHAR) == 'R' \
-   || (CHAR) == 'h' \
-   || (CHAR) == 'z')
-
 #define STDC_0_IN_SYSTEM_HEADERS 1
 
 /*
Index: gcc/config/microblaze/microblaze.h
===================================================================
--- gcc/config/microblaze/microblaze.h	(revision 165891)
+++ gcc/config/microblaze/microblaze.h	(working copy)
@@ -57,10 +57,6 @@  extern enum pipeline_type microblaze_pip
 /* Macros to decide whether certain features are available or not,
    depending on the instruction set architecture level.  */
 
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)						\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 #define DRIVER_SELF_SPECS    				\
 	"%{mxl-soft-mul:%<mno-xl-soft-mul}", 		\
 	"%{mno-xl-barrel-shift:%<mxl-barrel-shift}", 	\
Index: gcc/config/fr30/fr30.h
===================================================================
--- gcc/config/fr30/fr30.h	(revision 165891)
+++ gcc/config/fr30/fr30.h	(working copy)
@@ -22,15 +22,6 @@  along with GCC; see the file COPYING3.  
 <http://www.gnu.org/licenses/>.  */
 
 /*}}}*/ 
-/*{{{  Driver configuration.  */ 
-
-/* Defined in svr4.h.  */
-#undef SWITCH_TAKES_ARG
-
-/* Defined in svr4.h.  */
-#undef WORD_SWITCH_TAKES_ARG
-
-/*}}}*/ 
 /*{{{  Run-time target specifications.  */ 
 
 #undef  ASM_SPEC
Index: gcc/config/lm32/lm32.h
===================================================================
--- gcc/config/lm32/lm32.h	(revision 165891)
+++ gcc/config/lm32/lm32.h	(working copy)
@@ -68,12 +68,6 @@ 
 #undef  LIB_SPEC
 #define LIB_SPEC "%{!T*:-T sim.ld}"
 
-/* Add -G xx support.  */
-
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
-(DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 #undef  CC1_SPEC
 #define CC1_SPEC "%{G*}"
 
Index: gcc/config/netbsd-elf.h
===================================================================
--- gcc/config/netbsd-elf.h	(revision 165891)
+++ gcc/config/netbsd-elf.h	(working copy)
@@ -1,5 +1,5 @@ 
 /* Common configuration file for NetBSD ELF targets.
-   Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
    Contributed by Wasabi Systems, Inc.
 
 This file is part of GCC.
@@ -26,18 +26,6 @@  along with GCC; see the file COPYING3.  
     }						\
   while (0)
 
-/* This defines which switch letters take arguments.  On NetBSD, most
-   of the normal cases (defined by gcc.c) apply, and we also have -h*
-   and -z* options (for the linker) (coming from SVR4).  */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)			\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR)		\
-   || (CHAR) == 'h'				\
-   || (CHAR) == 'z'				\
-   || (CHAR) == 'R')
-
-
 /* Provide a STARTFILE_SPEC appropriate for NetBSD ELF.  Here we
    provide support for the special GCC option -static.  On ELF
    targets, we also add the crtbegin.o file, which provides part
Index: gcc/config/svr4.h
===================================================================
--- gcc/config/svr4.h	(revision 165891)
+++ gcc/config/svr4.h	(working copy)
@@ -1,7 +1,7 @@ 
 /* Operating system specific defines to be used when targeting GCC for some
    generic System V Release 4 system.
    Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2000, 2001, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com).
 
 This file is part of GCC.
@@ -41,26 +41,6 @@  see the files COPYING3 and COPYING.RUNTI
 
 /* Cpp, assembler, linker, library, and startfile spec's.  */
 
-/* This defines which switch letters take arguments.  On svr4, most of
-   the normal cases (defined in gcc.c) apply, and we also have -h* and
-   -z* options (for the linker).  Note however that there is no such
-   thing as a -T option for svr4.  */
-
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)		\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR)	\
-   || (CHAR) == 'h'			\
-   || (CHAR) == 'x'			\
-   || (CHAR) == 'z')
-
-/* This defines which multi-letter switches take arguments.  On svr4,
-   there are no such switches except those implemented by GCC itself.  */
-
-#define WORD_SWITCH_TAKES_ARG(STR)			\
- (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)			\
-  && strcmp (STR, "Tdata") && strcmp (STR, "Ttext")	\
-  && strcmp (STR, "Tbss"))
-
 /* Provide an ASM_SPEC appropriate for svr4.
    If we're not using GAS, we try to support as
    many of the specialized svr4 assembler options as seems reasonable,
Index: gcc/config/ia64/ia64.h
===================================================================
--- gcc/config/ia64/ia64.h	(revision 165891)
+++ gcc/config/ia64/ia64.h	(working copy)
@@ -53,9 +53,6 @@  do {						\
 
 #define ASM_EXTRA_SPEC ""
 
-#define SWITCH_TAKES_ARG(CHAR)						\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 /* Variables which are this size or smaller are put in the sdata/sbss
    sections.  */
 extern unsigned int ia64_section_threshold;
Index: gcc/config/rs6000/sysv4.h
===================================================================
--- gcc/config/rs6000/sysv4.h	(revision 165891)
+++ gcc/config/rs6000/sysv4.h	(working copy)
@@ -502,13 +502,6 @@  do {									\
 		 reg_names[1]);						\
 } while (0)
 
-/* Switch  Recognition by gcc.c.  Add -G xx support.  */
-
-/* Override svr4.h definition.  */
-#undef	SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)						\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 extern int fixuplabelno;
 
 /* Handle constructors specially for -mrelocatable.  */
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 165891)
+++ gcc/config/darwin.h	(working copy)
@@ -226,7 +226,6 @@  extern GTY(()) int darwin_ms_struct;
    !strcmp (STR, "sub_library") ? 1 :           \
    !strcmp (STR, "sub_umbrella") ? 1 :          \
    !strcmp (STR, "Zumbrella") ? 1 :             \
-   !strcmp (STR, "undefined") ? 1 :             \
    !strcmp (STR, "Zunexported_symbols_list") ? 1 : \
    !strcmp (STR, "Zweak_reference_mismatches") ? 1 : \
    !strcmp (STR, "pagezero_size") ? 1 :         \
@@ -236,7 +235,6 @@  extern GTY(()) int darwin_ms_struct;
    !strcmp (STR, "sectobjectsymbols") ? 2 :     \
    !strcmp (STR, "segcreate") ? 3 :             \
    !strcmp (STR, "dylinker_install_name") ? 1 : \
-   !strcmp (STR, "iframework") ? 1 : \
    0)
 
 #define SUBTARGET_C_COMMON_OVERRIDE_OPTIONS do {                        \
@@ -271,7 +269,7 @@  extern GTY(()) int darwin_ms_struct;
 #define LINK_COMMAND_SPEC_A \
    "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
     %(linker) %l %X %{d} %{s} %{t} %{Z} %{u*} \
-    %{A} %{e*} %{m} %{r} %{x} \
+    %{A} %{e*} %{m} %{r} \
     %{o*}%{!o:-o a.out} \
     %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
     %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
Index: gcc/config/score/score.h
===================================================================
--- gcc/config/score/score.h	(revision 165891)
+++ gcc/config/score/score.h	(working copy)
@@ -20,11 +20,6 @@ 
 
 #include "score-conv.h"
 
-/* Controlling the Compilation Driver.  */
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 #undef CPP_SPEC
 #define CPP_SPEC                 "%{mscore3:-D__score3__} %{G*}"
 
Index: gcc/config/mips/mips.h
===================================================================
--- gcc/config/mips/mips.h	(revision 165891)
+++ gcc/config/mips/mips.h	(working copy)
@@ -1075,12 +1075,6 @@  enum mips_code_readable_setting {
 /* The CACHE instruction is available.  */
 #define ISA_HAS_CACHE (TARGET_CACHE_BUILTIN && !TARGET_MIPS16)
 
-/* Add -G xx support.  */
-
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)						\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
-
 #define CONDITIONAL_REGISTER_USAGE mips_conditional_register_usage ()
 
 /* Tell collect what flags to pass to nm.  */
Index: gcc/config/mips/netbsd.h
===================================================================
--- gcc/config/mips/netbsd.h	(revision 165891)
+++ gcc/config/mips/netbsd.h	(working copy)
@@ -1,6 +1,6 @@ 
 /* Definitions of target machine for GNU compiler, for MIPS NetBSD systems.
    Copyright (C) 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-   2007 Free Software Foundation, Inc.
+   2007, 2010 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -170,16 +170,6 @@  along with GCC; see the file COPYING3.  
 #define MIPS_DEFAULT_GVALUE 0
 
 
-/* This defines which switch letters take arguments.  -G is a MIPS
-   special.  */
-
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)						\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR)					\
-   || (CHAR) == 'R'							\
-   || (CHAR) == 'G')
-
-
 #undef ASM_FINAL_SPEC
 #undef SET_ASM_OP
 
Index: gcc/config/mips/vxworks.h
===================================================================
--- gcc/config/mips/vxworks.h	(revision 165891)
+++ gcc/config/mips/vxworks.h	(working copy)
@@ -1,4 +1,5 @@ 
-/* Copyright (C) 1999, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2003, 2004, 2007, 2008, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -19,15 +20,6 @@  along with GCC; see the file COPYING3.  
 #undef  TARGET_VERSION
 #define TARGET_VERSION fprintf (stderr, " (MIPS, VxWorks syntax)");
 
-/* Combination of mips.h and svr4.h.  */
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)          \
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR)      \
-   || (CHAR) == 'G'                     \
-   || (CHAR) == 'h'                     \
-   || (CHAR) == 'x'                     \
-   || (CHAR) == 'z')
-
 #undef  ASM_SPEC
 #define ASM_SPEC "\
 %{!G:-G 0} %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \
Index: gcc/config/openbsd.h
===================================================================
--- gcc/config/openbsd.h	(revision 165891)
+++ gcc/config/openbsd.h	(working copy)
@@ -1,5 +1,6 @@ 
 /* Base configuration file for all OpenBSD targets.
-   Copyright (C) 1999, 2000, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2004, 2005, 2007, 2009, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -118,13 +119,6 @@  while (0)
 
 #ifndef OBSD_HAS_CORRECT_SPECS
 
-#ifndef OBSD_NO_DYNAMIC_LIBRARIES
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) \
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
-   || (CHAR) == 'R')
-#endif
-
 #undef CPP_SPEC
 #define CPP_SPEC OBSD_CPP_SPEC
 
Index: gcc/config/freebsd-spec.h
===================================================================
--- gcc/config/freebsd-spec.h	(revision 165891)
+++ gcc/config/freebsd-spec.h	(working copy)
@@ -1,5 +1,6 @@ 
 /* Base configuration file for all FreeBSD targets.
-   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2009, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -33,17 +34,6 @@  see the files COPYING3 and COPYING.RUNTI
 /* In case we need to know.  */
 #define USING_CONFIG_FREEBSD_SPEC 1
 
-/* This defines which switch letters take arguments.  On FreeBSD, most of
-   the normal cases (defined in gcc.c) apply, and we also have -h* and
-   -z* options (for the linker) (coming from SVR4).
-   We also have -R (alias --rpath), no -z, --soname (-h), --assert etc.  */
-
-#define FBSD_SWITCH_TAKES_ARG(CHAR)					\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR)					\
-    || (CHAR) == 'h'							\
-    || (CHAR) == 'z' /* ignored by ld */				\
-    || (CHAR) == 'R')
-
 /* This defines which multi-letter switches take arguments.  */
 
 #define FBSD_WORD_SWITCH_TAKES_ARG(STR)					\
Index: gcc/config/freebsd.h
===================================================================
--- gcc/config/freebsd.h	(revision 165891)
+++ gcc/config/freebsd.h	(working copy)
@@ -30,13 +30,8 @@  along with GCC; see the file COPYING3.  
 /* In case we need to know.  */
 #define USING_CONFIG_FREEBSD 1
 
-/* This defines which switch letters take arguments.  On FreeBSD, most of
-   the normal cases (defined in gcc.c) apply, and we also have -h* and
-   -z* options (for the linker) (coming from SVR4).
-   We also have -R (alias --rpath), no -z, --soname (-h), --assert etc.  */
-
-#undef  SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR))
+/* This defines which switch words take arguments.
+   We have --assert etc.  */
 
 #undef  WORD_SWITCH_TAKES_ARG
 #define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))