From 63826d5b39ed3e826dcbf443e84ff92dc5774ed0 Mon Sep 17 00:00:00 2001
From: Neil Booth <neil@daikokuya.demon.co.uk>
Date: Mon, 13 May 2002 19:10:16 +0000
Subject: [PATCH] gcc.c (SWITCH_TAKES_ARG): Remove 'V'.

	* gcc.c (SWITCH_TAKES_ARG): Remove 'V'.
	(translate_options): Remove 'V'.
	(process_command): Similarly.
doc:
	* invoke.texi: Remove documentation of 'V'.

From-SVN: r53425
---
 gcc/ChangeLog       |  8 ++++++++
 gcc/doc/invoke.texi | 27 ++++++-------------------
 gcc/gcc.c           | 49 +++------------------------------------------
 3 files changed, 17 insertions(+), 67 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 45b8128aba19..2ebc0bdd9f80 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2002-05-13  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+	* gcc.c (SWITCH_TAKES_ARG): Remove 'V'.
+	(translate_options): Remove 'V'.
+	(process_command): Similarly.
+doc:
+	* invoke.texi: Remove documentation of 'V'.
+
 2002-05-13  Ulrich Weigand  <uweigand@de.ibm.com>
 
 	* config/s390/linux.h: Revert 2002-04-22 changes.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 68b888fca940..001ab25b5f8f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -322,7 +322,7 @@ in the following sections.
 @c I wrote this xref this way to avoid overfull hbox. -- rms
 @xref{Target Options}.
 @gccoptlist{
--b @var{machine}  -V @var{version}}
+-b @var{machine}}
 
 @item Machine Dependent Options
 @xref{Submodel Options,,Hardware Models and Configurations}.
@@ -4756,40 +4756,26 @@ would specify @option{-b i386v} to run that cross compiler.
 
 When you do not specify @option{-b}, it normally means to compile for
 the same type of machine that you are using.
-
-@item -V @var{version}
-@opindex V
-The argument @var{version} specifies which version of GCC to run.
-This is useful when multiple versions are installed.  For example,
-@var{version} might be @samp{2.0}, meaning to run GCC version 2.0.
-
-The default version, when you do not specify @option{-V}, is the last
-version of GCC that you installed.
 @end table
 
-The @option{-b} and @option{-V} options actually work by controlling part of
+The @option{-b} option actually works by controlling part of
 the file name used for the executable files and libraries used for
 compilation.  A given version of GCC, for a given target machine, is
 normally kept in the directory @file{/usr/local/lib/gcc-lib/@var{machine}/@var{version}}.
 
-Thus, sites can customize the effect of @option{-b} or @option{-V} either by
+Thus, sites can customize the effect of @option{-b} either by
 changing the names of these directories or adding alternate names (or
 symbolic links).  If in directory @file{/usr/local/lib/gcc-lib/} the
 file @file{80386} is a link to the file @file{i386v}, then @option{-b
 80386} becomes an alias for @option{-b i386v}.
 
-In one respect, the @option{-b} or @option{-V} do not completely change
+In one respect, @option{-b} does not completely change
 to a different compiler: the top-level driver program @command{gcc}
 that you originally invoked continues to run and invoke the other
 executables (preprocessor, compiler per se, assembler and linker)
 that do the real work.  However, since no real work is done in the
 driver program, it usually does not matter that the driver program
-in use is not the one for the specified target.  It is common for the
-interface to the other executables to change incompatibly between
-compiler versions, so unless the version specified is very close to that
-of the driver (for example, @option{-V 3.0} with a driver program from GCC
-version 3.0.1), use of @option{-V} may not work; for example, using
-@option{-V 2.95.2} will not work with a driver program from GCC 3.0.
+in use is not the one for the specified target.
 
 The only way that the driver program depends on the target machine is
 in the parsing and handling of special machine-specific options.
@@ -4807,8 +4793,7 @@ different targets or versions, under different names.
 For example, if the driver for version 2.0 is installed as @command{ogcc}
 and that for version 2.1 is installed as @command{gcc}, then the command
 @command{gcc} will use version 2.1 by default, while @command{ogcc} will use
-2.0 by default.  However, you can choose either version with either
-command with the @option{-V} option.
+2.0 by default.
 
 @node Submodel Options
 @section Hardware Models and Configurations
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1f8fb15dda16..f673812888ec 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -745,8 +745,7 @@ static struct user_specs *user_specs_head, *user_specs_tail;
   ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
    || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
    || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
-   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
-   || (CHAR) == 'B' || (CHAR) == 'b')
+   || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'B' || (CHAR) == 'b')
 
 #ifndef SWITCH_TAKES_ARG
 #define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
@@ -1185,7 +1184,7 @@ translate_options (argcp, argvp)
 	    nskip += SWITCH_TAKES_ARG (c) - (p[1] != 0);
 	  else if (WORD_SWITCH_TAKES_ARG (p))
 	    nskip += WORD_SWITCH_TAKES_ARG (p);
-	  else if ((c == 'B' || c == 'b' || c == 'V' || c == 'x')
+	  else if ((c == 'B' || c == 'b' || c == 'x')
 		   && p[1] == 0)
 	    nskip += 1;
 	  else if (! strcmp (p, "Xlinker"))
@@ -3606,48 +3605,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
 	      verbose_flag++;
 	      break;
 
-	    case 'V':
-	      n_switches++;
-	      if (p[1] == 0 && i + 1 == argc)
-		fatal ("argument to `-V' is missing");
-	      if (p[1] == 0)
-		spec_version = argv[++i];
-	      else
-		spec_version = p + 1;
-	      compiler_version = spec_version;
-	      warn_std_ptr = &warn_std;
-
-	      /* Validate the version number.  Use the same checks
-		 done when inserting it into a spec.
-
-		 The format of the version string is
-		 ([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)?  */
-	      {
-		const char *v = compiler_version;
-
-		/* Ignore leading non-digits.  i.e. "foo-" in "foo-2.7.2".  */
-		while (! ISDIGIT (*v))
-		  v++;
-
-		if (v > compiler_version && v[-1] != '-')
-		  fatal ("invalid version number format");
-
-		/* Set V after the first period.  */
-		while (ISDIGIT (*v))
-		  v++;
-
-		if (*v != '.')
-		  fatal ("invalid version number format");
-
-		v++;
-		while (ISDIGIT (*v))
-		  v++;
-
-		if (*v != 0 && *v != ' ' && *v != '.' && *v != '-')
-		  fatal ("invalid version number format");
-	      }
-	      break;
-
 	    case 'S':
 	    case 'c':
 	      if (p[1] == 0)
@@ -4005,7 +3962,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
 	  else
 	    {
 	      char ch = switches[n_switches].part1[0];
-	      if (ch == 'V' || ch == 'b' || ch == 'B')
+	      if (ch == 'b' || ch == 'B')
 		switches[n_switches].validated = 1;
 	    }
 	  n_switches++;
-- 
GitLab