OSDN Git Service

libitm: Remove unused code.
[pf3gnuchains/gcc-fork.git] / gcc / opts.c
index c3e7bc7..9fdb226 100644 (file)
@@ -35,6 +35,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "insn-attr-common.h"
 #include "common/common-target.h"
 
+/* Indexed by enum debug_info_type.  */
+const char *const debug_type_names[] =
+{
+  "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
+};
+
 /* Parse the -femit-struct-debug-detailed option value
    and set the flag variables. */
 
@@ -428,6 +434,7 @@ static const struct default_options default_options_table[] =
     { OPT_LEVELS_1_PLUS, OPT_fipa_reference, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_fipa_profile, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_fmerge_constants, NULL, 1 },
+    { OPT_LEVELS_1_PLUS, OPT_fshrink_wrap, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_fsplit_wide_types, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_ftree_ccp, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_ftree_bit_ccp, NULL, 1 },
@@ -478,6 +485,8 @@ static const struct default_options default_options_table[] =
     { OPT_LEVELS_2_PLUS, OPT_falign_jumps, NULL, 1 },
     { OPT_LEVELS_2_PLUS, OPT_falign_labels, NULL, 1 },
     { OPT_LEVELS_2_PLUS, OPT_falign_functions, NULL, 1 },
+    { OPT_LEVELS_2_PLUS, OPT_ftree_tail_merge, NULL, 1 },
+    { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_foptimize_strlen, NULL, 1 },
 
     /* -O3 optimizations.  */
     { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
@@ -760,11 +769,6 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
       maybe_set_param_value (PARAM_STACK_FRAME_GROWTH, 40,
                             opts->x_param_values, opts_set->x_param_values);
     }
-  if (opts->x_flag_wpa || opts->x_flag_ltrans)
-    {
-      /* These passes are not WHOPR compatible yet.  */
-      opts->x_flag_ipa_pta = 0;
-    }
 
   if (opts->x_flag_lto)
     {
@@ -778,7 +782,11 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
 #else
       error_at (loc, "LTO support has not been enabled in this configuration");
 #endif
-    }
+      if (!opts->x_flag_fat_lto_objects && !HAVE_LTO_PLUGIN)
+        error_at (loc, "-fno-fat-lto-objects are supported only with linker plugin.");
+      if (opts->x_flag_tm)
+       error_at (loc, "LTO is currently not supported with transactional memory");
+}
   if ((opts->x_flag_lto_partition_balanced != 0) + (opts->x_flag_lto_partition_1to1 != 0)
        + (opts->x_flag_lto_partition_none != 0) >= 1)
     {
@@ -986,7 +994,7 @@ print_filtered_help (unsigned int include_flags,
 
       /* With the -Q option enabled we change the descriptive text associated
         with an option to be an indication of its current setting.  */
-      if (!quiet_flag)
+      if (!opts->x_quiet_flag)
        {
          void *flag_var = option_flag_var (i, opts);
 
@@ -1124,7 +1132,7 @@ print_specific_help (unsigned int include_flags,
 
   /* Sanity check: Make sure that we do not have more
      languages than we have bits available to enumerate them.  */
-  gcc_assert ((1U << cl_lang_count) < CL_MIN_OPTION_CLASS);
+  gcc_assert ((1U << cl_lang_count) <= CL_MIN_OPTION_CLASS);
 
   /* If we have not done so already, obtain
      the desired maximum width of the output.  */
@@ -1246,6 +1254,9 @@ common_handle_option (struct gcc_options *opts,
        unsigned int undoc_mask;
        unsigned int i;
 
+       if (lang_mask == CL_DRIVER)
+         break;;
+
        undoc_mask = ((opts->x_verbose_flag | opts->x_extra_warnings)
                      ? 0
                      : CL_UNDOCUMENTED);
@@ -1265,6 +1276,9 @@ common_handle_option (struct gcc_options *opts,
       }
 
     case OPT__target_help:
+      if (lang_mask == CL_DRIVER)
+       break;
+
       print_specific_help (CL_TARGET, CL_UNDOCUMENTED, 0, opts, lang_mask);
       opts->x_exit_after_options = true;
       break;
@@ -1280,6 +1294,9 @@ common_handle_option (struct gcc_options *opts,
           --help=target,^undocumented  */
        unsigned int exclude_flags = 0;
 
+       if (lang_mask == CL_DRIVER)
+         break;
+
        /* Walk along the argument string, parsing each word in turn.
           The format is:
           arg = [^]{word}[,{arg}]
@@ -1390,6 +1407,9 @@ common_handle_option (struct gcc_options *opts,
       }
 
     case OPT__version:
+      if (lang_mask == CL_DRIVER)
+       break;
+
       opts->x_exit_after_options = true;
       break;
 
@@ -1400,6 +1420,9 @@ common_handle_option (struct gcc_options *opts,
       break;
 
     case OPT_Werror_:
+      if (lang_mask == CL_DRIVER)
+       break;
+
       enable_warning_as_error (arg, value, lang_mask, handlers,
                               opts, opts_set, loc, dc);
       break;
@@ -1576,7 +1599,7 @@ common_handle_option (struct gcc_options *opts,
       /* FIXME: Instrumentation we insert makes ipa-reference bitmaps
         quadratic.  Disable the pass until better memory representation
         is done.  */
-      if (!opts_set->x_flag_ipa_reference && in_lto_p)
+      if (!opts_set->x_flag_ipa_reference && opts->x_in_lto_p)
         opts->x_flag_ipa_reference = false;
       break;
 
@@ -1666,7 +1689,7 @@ common_handle_option (struct gcc_options *opts,
       if (value < 2 || value > 4)
        error_at (loc, "dwarf version %d is not supported", value);
       else
-       dwarf_version = value;
+       opts->x_dwarf_version = value;
       set_debug_level (DWARF2_DEBUG, false, "", opts, opts_set, loc);
       break;
 
@@ -1713,7 +1736,7 @@ common_handle_option (struct gcc_options *opts,
 
     case OPT_Wuninitialized:
       /* Also turn on maybe uninitialized warning.  */
-      warn_maybe_uninitialized = value;
+      opts->x_warn_maybe_uninitialized = value;
       break;
 
     default: