OSDN Git Service

PR c++/48969
[pf3gnuchains/gcc-fork.git] / gcc / opts-global.c
index 3ed562d..6fdc951 100644 (file)
@@ -30,6 +30,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "tm.h" /* Required by rtl.h.  */
 #include "rtl.h"
+#include "dbgcnt.h"
+#include "debug.h"
 #include "lto-streamer.h"
 #include "output.h"
 #include "plugin.h"
@@ -227,11 +229,12 @@ read_cmdline_options (struct gcc_options *opts, struct gcc_options *opts_set,
          gcc_assert (opts == &global_options);
          gcc_assert (opts_set == &global_options_set);
 
-         if (main_input_filename == NULL)
+         if (opts->x_main_input_filename == NULL)
            {
-             main_input_filename = decoded_options[i].arg;
-             main_input_baselength
-               = base_of_path (main_input_filename, &main_input_basename);
+             opts->x_main_input_filename = decoded_options[i].arg;
+             opts->x_main_input_baselength
+               = base_of_path (opts->x_main_input_filename,
+                               &opts->x_main_input_basename);
            }
          add_input_filename (decoded_options[i].arg);
          continue;
@@ -307,11 +310,6 @@ decode_options (struct gcc_options *opts, struct gcc_options *opts_set,
 
   set_default_handlers (&handlers);
 
-  /* Enable -Werror=coverage-mismatch by default.  */
-  control_warning_option (OPT_Wcoverage_mismatch, (int) DK_ERROR, true,
-                         loc, lang_mask,
-                         &handlers, opts, opts_set, dc);
-
   default_options_optimization (opts, opts_set,
                                decoded_options, decoded_options_count,
                                loc, lang_mask, &handlers, dc);
@@ -326,7 +324,7 @@ decode_options (struct gcc_options *opts, struct gcc_options *opts_set,
                        loc, lang_mask,
                        &handlers, dc);
 
-  finish_options (opts, opts_set);
+  finish_options (opts, opts_set, loc);
 }
 
 /* Process common options that have been deferred until after the
@@ -340,6 +338,9 @@ handle_common_deferred_options (void)
   VEC(cl_deferred_option,heap) *vec
     = (VEC(cl_deferred_option,heap) *) common_deferred_options;
 
+  if (flag_dump_all_passed)
+    enable_rtl_dump_file ();
+
   FOR_EACH_VEC_ELT (cl_deferred_option, vec, i, opt)
     {
       switch (opt->opt_index)
@@ -352,11 +353,31 @@ handle_common_deferred_options (void)
          fix_register (opt->arg, 0, 0);
          break;
 
+       case OPT_fdbg_cnt_:
+         dbg_cnt_process_opt (opt->arg);
+         break;
+
+       case OPT_fdbg_cnt_list:
+         dbg_cnt_list_all_counters ();
+         break;
+
+       case OPT_fdebug_prefix_map_:
+         add_debug_prefix_map (opt->arg);
+         break;
+
        case OPT_fdump_:
          if (!dump_switch_p (opt->arg))
            error ("unrecognized command line option %<-fdump-%s%>", opt->arg);
          break;
 
+       case OPT_fenable_:
+       case OPT_fdisable_:
+         if (opt->opt_index == OPT_fenable_)
+           enable_pass (opt->arg);
+          else
+           disable_pass (opt->arg);
+          break;
+
        case OPT_ffixed_:
          /* Deferred.  */
          fix_register (opt->arg, 1, 1);
@@ -378,10 +399,20 @@ handle_common_deferred_options (void)
 #endif
          break;
 
+       case OPT_frandom_seed:
+         /* The real switch is -fno-random-seed.  */
+         if (!opt->value)
+           set_random_seed (NULL);
+         break;
+
+       case OPT_frandom_seed_:
+         set_random_seed (opt->arg);
+         break;
+
        case OPT_fstack_limit:
          /* The real switch is -fno-stack-limit.  */
-         gcc_assert (!opt->value);
-         stack_limit_rtx = NULL_RTX;
+         if (!opt->value)
+           stack_limit_rtx = NULL_RTX;
          break;
 
        case OPT_fstack_limit_register_: