This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix PR c/4988


--target-help (and --help) print out the information from the main
compiler twice.  This is because the driver passes the option twice on
its command line.

This is fixed by the patch below.  As it is also a 2.95.x regression,
and IMO obvious, it should go on the branch too.  Is that OK Mark?

22 lines bite the dust.  OK to commit?

Neil.

	PR c/4988
	* gcc.c (cc1_options): Remove --target-help and --help.
	(process_command): Don't preseve the options for passing
	to cc1; passing them to the preprocessor suffices.	

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.272
diff -u -p -r1.272 gcc.c
--- gcc.c	2001/12/03 19:13:22	1.272
+++ gcc.c	2001/12/03 20:34:05
@@ -689,9 +689,7 @@ static const char *cc1_options =
  %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
  %{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*} %{ansi}\
  %{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
- %{Qn:-fno-ident} %{--help:--help}\
- %{--target-help:--target-help}\
- %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
+ %{Qn:-fno-ident} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
  %{fsyntax-only:-o %j} %{-param*}";
 
 static const char *asm_options =
@@ -3308,7 +3306,6 @@ process_command (argc, argv)
 
 	  /* We will be passing a dummy file on to the sub-processes.  */
 	  n_infiles++;
-	  n_switches++;
 
 	  add_preprocessor_option ("--help", 6);
 	  add_assembler_option ("--help", 6);
@@ -3321,7 +3318,6 @@ process_command (argc, argv)
 
           /* We will be passing a dummy file on to the sub-processes.  */
           n_infiles++;
-          n_switches++;
 
           add_preprocessor_option ("--target-help", 13);
           add_assembler_option ("--target-help", 13);
@@ -3800,15 +3796,6 @@ process_command (argc, argv)
               the various sub-processes.  */
            infiles[n_infiles].language = "c";
            infiles[n_infiles++].name   = "target-dummy";
-
-           /* Preserve the --target-help switch so that it can be caught by
-              the cc1 spec string.  */
-           switches[n_switches].part1     = "--target-help";
-           switches[n_switches].args      = 0;
-           switches[n_switches].live_cond = SWITCH_OK;
-           switches[n_switches].validated = 0;
-
-           n_switches++;
         }
       else if (strcmp (argv[i], "-fhelp") == 0)
 	{
@@ -3818,15 +3805,6 @@ process_command (argc, argv)
 		 the various sub-processes.  */
 	      infiles[n_infiles].language = "c";
 	      infiles[n_infiles++].name   = "help-dummy";
-
-	      /* Preserve the --help switch so that it can be caught by the
-		 cc1 spec string.  */
-	      switches[n_switches].part1     = "--help";
-	      switches[n_switches].args      = 0;
-	      switches[n_switches].live_cond = SWITCH_OK;
-	      switches[n_switches].validated = 0;
-
-	      n_switches++;
 	    }
 	}
       else if (argv[i][0] == '+' && argv[i][1] == 'e')


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]