re PR driver/54789 (Error in GCC driver when defining GCC_COMPARE_DEBUG)
authorDmitry Gorbachev <d.g.gorbachev@gmail.com>
Thu, 8 Nov 2012 20:13:13 +0000 (20:13 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 8 Nov 2012 20:13:13 +0000 (21:13 +0100)
PR driver/54789
* gcc.c (process_command): Use save_switch for synthesized
-fcompare-debug=* option; mark the switch as known.

From-SVN: r193337

gcc/ChangeLog
gcc/gcc.c

index 6510337aafcd44ddbffbeaf9c41bd4689e1402b3..1730844015329eaac074545a0aa0379daf266a6c 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-08  Dmitry Gorbachev  <d.g.gorbachev@gmail.com>
+
+       PR driver/54789
+       * gcc.c (process_command): Use save_switch for synthesized
+       -fcompare-debug=* option; mark the switch as known.
+
 2012-11-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/54308
index a795981f00298eed4a0ee8e99d7a84dd7e3ff951..b80af44282ef62cc9a18a09bb48cfda3da082fd3 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3978,18 +3978,12 @@ process_command (unsigned int decoded_options_count,
   if (n_infiles == last_language_n_infiles && spec_lang != 0)
     warning (0, "%<-x %s%> after last input file has no effect", spec_lang);
 
+  /* Synthesize -fcompare-debug flag from the GCC_COMPARE_DEBUG
+     environment variable.  */
   if (compare_debug == 2 || compare_debug == 3)
     {
-      alloc_switch ();
-      switches[n_switches].part1 = concat ("fcompare-debug=",
-                                          compare_debug_opt,
-                                          NULL);
-      switches[n_switches].args = 0;
-      switches[n_switches].live_cond = 0;
-      switches[n_switches].validated = false;
-      switches[n_switches].known = false;
-      switches[n_switches].ordering = 0;
-      n_switches++;
+      const char *opt = concat ("-fcompare-debug=", compare_debug_opt, NULL);
+      save_switch (opt, 0, NULL, false, true);
       compare_debug = 1;
     }