OSDN Git Service

* obj-c++.dg/bitfield-[1-5].mm: New.
[pf3gnuchains/gcc-fork.git] / gcc / opts.c
index 70a9b22..896728c 100644 (file)
@@ -255,7 +255,7 @@ complain_wrong_lang (const char *text, const struct cl_option *option,
   bad_lang = write_langs (lang_mask);
 
   /* Eventually this should become a hard error IMO.  */
-  warning ("command line option \"%s\" is valid for %s but not for %s",
+  warning (0, "command line option \"%s\" is valid for %s but not for %s",
           text, ok_langs, bad_lang);
 
   free (ok_langs);
@@ -315,6 +315,14 @@ handle_option (const char **argv, unsigned int lang_mask)
   /* We've recognized this switch.  */
   result = 1;
 
+  /* Check to see if the option is disabled for this configuration.  */
+  if (option->flags & CL_DISABLED)
+    {
+      error ("command line option %qs"
+            " is not supported by this configuration", opt);
+      goto done;
+    }
+
   /* Sort out any argument the switch takes.  */
   if (option->flags & CL_JOINED)
     {
@@ -660,7 +668,7 @@ decode_options (unsigned int argc, const char **argv)
         this to `2' if -Wall is used, so we can avoid giving out
         lots of errors for people who don't realize what -Wall does.  */
       if (warn_uninitialized == 1)
-       warning ("-Wuninitialized is not supported without -O");
+       warning (0, "-Wuninitialized is not supported without -O");
     }
 
   if (flag_really_no_inline == 2)
@@ -678,6 +686,15 @@ decode_options (unsigned int argc, const char **argv)
       flag_reorder_blocks_and_partition = 0;
       flag_reorder_blocks = 1;
     }
+
+  if (flag_reorder_blocks_and_partition
+      && !targetm.have_named_sections)
+    {
+      inform 
+       ("-freorder-blocks-and-partition does not work on this architecture.");
+      flag_reorder_blocks_and_partition = 0;
+      flag_reorder_blocks = 1;
+    }
 }
 
 /* Handle target- and language-independent options.  Return zero to
@@ -809,6 +826,10 @@ common_handle_option (size_t scode, const char *arg, int value)
        return 0;
       break;
 
+    case OPT_fdiagnostics_show_option:
+      global_dc->show_option_requested = true;
+      break;
+
     case OPT_fdump_:
       if (!dump_switch_p (arg))
        return 0;
@@ -975,7 +996,7 @@ common_handle_option (size_t scode, const char *arg, int value)
       else if (!strcmp (arg, "local-exec"))
        flag_tls_default = TLS_MODEL_LOCAL_EXEC;
       else
-       warning ("unknown tls-model \"%s\"", arg);
+       warning (0, "unknown tls-model \"%s\"", arg);
       break;
 
     case OPT_ftracer:
@@ -1027,10 +1048,8 @@ common_handle_option (size_t scode, const char *arg, int value)
     default:
       /* If the flag was handled in a standard way, assume the lack of
         processing here is intentional.  */
-      if (cl_options[scode].flag_var)
-       break;
-
-      abort ();
+      gcc_assert (cl_options[scode].flag_var);
+      break;
     }
 
   return 1;
@@ -1148,7 +1167,7 @@ set_debug_level (enum debug_info_type type, int extended, const char *arg)
            }
 
          if (write_symbols == NO_DEBUG)
-           warning ("target system does not support debug output");
+           warning (0, "target system does not support debug output");
        }
     }
   else
@@ -1393,8 +1412,9 @@ wrap_help (const char *help, const char *item, unsigned int item_width)
    a simple on-off switch.  */
 
 int
-option_enabled (const struct cl_option *option)
+option_enabled (int opt_idx)
 {
+  const struct cl_option *option = &(cl_options[opt_idx]);
   if (option->flag_var)
     switch (option->var_cond)
       {