Index: gcc/doc/options.texi
===================================================================
--- gcc/doc/options.texi	(revision 192379)
+++ gcc/doc/options.texi	(working copy)
@@ -461,15 +461,19 @@ value of @option{-fmath-errno} for langu
 
 @item EnabledBy(@var{opt})
 If not explicitly set, the option is set to the value of @option{-@var{opt}}.
 
 @item LangEnabledBy(@var{language}, @var{opt})
+@itemx LangEnabledBy(@var{language}, @var{opt}, @var{posarg}, @var{negarg})
 When compiling for the given language, the option is set to the value
-of @option{-@var{opt}}, if not explicitly set. It is possible to
-specify several different languages.  Each @var{language} must have
-been declared by an earlier @code{Language} record.  @xref{Option file
-format}.
+of @option{-@var{opt}}, if not explicitly set. In the second form, if
+@var{opt} is used in the positive form then @var{posarg} is considered
+to be passed to the option, and if @var{opt} is used in the negative
+form then @var{negarg} is considered to be passed to the option.  It
+is possible to specify several different languages.  Each
+@var{language} must have been declared by an earlier @code{Language}
+record.  @xref{Option file format}.
 
 @item NoDWARFRecord
 The option is omitted from the producer string written by
 @option{-grecord-gcc-switches}.
 @end table
Index: gcc/flags.h
===================================================================
--- gcc/flags.h	(revision 192379)
+++ gcc/flags.h	(working copy)
@@ -35,18 +35,10 @@ extern int base_of_path (const char *pat
 
 /* Return true iff flags are set as if -ffast-math.  */
 extern bool fast_math_flags_set_p (const struct gcc_options *);
 extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
 
-/* Used to set the level of -Wstrict-aliasing in OPTS, when no level
-   is specified.  The external way to set the default level is to use
-   -Wstrict-aliasing=level.
-   ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified,
-   and 0 otherwise.  After calling this function, wstrict_aliasing will be
-   set to the default value of -Wstrict_aliasing=level.  */
-
-extern void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
 
 /* Now the symbols that are set with `-f' switches.  */
 
 /* True if printing into -fdump-final-insns= dump.  */
 
Index: gcc/c-family/c.opt
===================================================================
--- gcc/c-family/c.opt	(revision 192379)
+++ gcc/c-family/c.opt	(working copy)
@@ -619,10 +619,19 @@ Warn about signed-unsigned comparisons
 
 Wsign-promo
 C++ ObjC++ Var(warn_sign_promo) Warning
 Warn when overload promotes from unsigned to signed
 
+Wstrict-aliasing=
+C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 3, 0)
+;
+
+Wstrict-overflow=
+C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
+;
+
+
 Wstrict-null-sentinel
 C++ ObjC++ Warning Var(warn_strict_null_sentinel)
 Warn about uncasted NULL used as sentinel
 
 Wstrict-prototypes
Index: gcc/c-family/c-opts.c
===================================================================
--- gcc/c-family/c-opts.c	(revision 192379)
+++ gcc/c-family/c-opts.c	(working copy)
@@ -358,10 +358,11 @@ c_common_handle_option (size_t scode, co
     case OPT_U:
       defer_opt (code, arg);
       break;
 
     case OPT_Wall:
+      /* ??? Don't add new options here. Use LangEnabledBy in c.opt.  */
       handle_generated_option (&global_options, &global_options_set,
 			       OPT_Wunused, NULL, value,
 			       c_family_lang_mask, kind, loc,
 			       handlers, global_dc);
       set_Wformat (value);
@@ -373,15 +374,11 @@ c_common_handle_option (size_t scode, co
       warn_parentheses = value;
       warn_return_type = value;
       warn_sequence_point = value;	/* Was C only.  */
       warn_switch = value;
       warn_sizeof_pointer_memaccess = value;
-      if (warn_strict_aliasing == -1)
-	set_Wstrict_aliasing (&global_options, value);
       warn_address = value;
-      if (warn_strict_overflow == -1)
-	warn_strict_overflow = value;
       warn_array_bounds = value;
       warn_volatile_register_var = value;
 
       /* Only warn about unknown pragmas that are not in system
 	 headers.  */
@@ -937,15 +934,10 @@ c_common_post_options (const char **pfil
   /* -Wpointer-sign is disabled by default, but it is enabled if any
      of -Wall or -Wpedantic are given.  */
   if (warn_pointer_sign == -1)
     warn_pointer_sign = 0;
 
-  if (warn_strict_aliasing == -1)
-    warn_strict_aliasing = 0;
-  if (warn_strict_overflow == -1)
-    warn_strict_overflow = 0;
-
   /* -Woverlength-strings is off by default, but is enabled by -Wpedantic.
      It is never enabled in C++, as the minimum limit is not normative
      in that standard.  */
   if (warn_overlength_strings == -1 || c_dialect_cxx ())
     warn_overlength_strings = 0;
Index: gcc/testsuite/gcc.dg/Wstrict-overflow-24.c
===================================================================
--- gcc/testsuite/gcc.dg/Wstrict-overflow-24.c	(revision 0)
+++ gcc/testsuite/gcc.dg/Wstrict-overflow-24.c	(revision 0)
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-fstrict-overflow -O2" } */
+/* { dg-message "warnings being treated as errors" "" {target "*-*-*"} 0 } */
+#pragma GCC diagnostic error "-Wstrict-overflow"
+
+int
+foo (int i)
+{
+  return __builtin_abs (i) >= 0; /* { dg-error "assuming signed overflow does not occur" "correct warning" } */
+}
Index: gcc/opts.c
===================================================================
--- gcc/opts.c	(revision 192379)
+++ gcc/opts.c	(working copy)
@@ -35,10 +35,12 @@ along with GCC; see the file COPYING3.  
 #include "diagnostic.h"
 #include "opts-diagnostic.h"
 #include "insn-attr-common.h"
 #include "common/common-target.h"
 
+static void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
+
 /* Indexed by enum debug_info_type.  */
 const char *const debug_type_names[] =
 {
   "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
 };
@@ -1799,11 +1801,11 @@ handle_param (struct gcc_options *opts, 
    when no level is specified (i.e., when -Wstrict-aliasing, and not
    -Wstrict-aliasing=level was given).
    ONOFF is assumed to take value 1 when -Wstrict-aliasing is specified,
    and 0 otherwise.  After calling this function, wstrict_aliasing will be
    set to the default value of -Wstrict_aliasing=level, currently 3.  */
-void
+static void
 set_Wstrict_aliasing (struct gcc_options *opts, int onoff)
 {
   gcc_assert (onoff == 0 || onoff == 1);
   if (onoff != 0)
     opts->x_warn_strict_aliasing = 3;
Index: gcc/optc-gen.awk
===================================================================
--- gcc/optc-gen.awk	(revision 192379)
+++ gcc/optc-gen.awk	(working copy)
@@ -46,30 +46,40 @@ for (i = 0; i < n_opts; i++) {
         } else {
             if (enables[enabledby_name] == "") {
                 enabledby[n_enabledby] = enabledby_name;
                 n_enabledby++;
             }
-            enables[enabledby_name] = enables[enabledby_name] opts[i] ",";
+            enables[enabledby_name] = enables[enabledby_name] opts[i] ";";
         }
     }
 
     enabledby_arg = opt_args("LangEnabledBy", flags[i]);
     if (enabledby_arg != "") {
         n_enabledby_arg_langs = split(nth_arg(0, enabledby_arg), enabledby_arg_langs, " ");
         enabledby_name = nth_arg(1, enabledby_arg);
+        enabledby_posarg = nth_arg(2, enabledby_arg)
+	enabledby_negarg = nth_arg(3, enabledby_arg)
         enabledby_index = opt_numbers[enabledby_name];
         if (enabledby_index == "") {
-            print "#error Enabledby: " enabledby_name 
+            print "#error LangEnabledby: " enabledby_name 
         } else {
+            if (enabledby_posarg != "" && enabledby_negarg != "") {
+                with_args = "," enabledby_posarg "," enabledby_negarg
+            } else if (enabledby_posarg == "" && enabledby_negarg == "") {
+                with_args = ""
+            } else {
+                print "#error LangEnabledBy with three arguments, it should have either 2 or 4"
+            }
+
             for (j = 1; j <= n_enabledby_arg_langs; j++) {
                 lang_name = lang_sanitized_name(enabledby_arg_langs[j]);
                 lang_index = lang_numbers[enabledby_arg_langs[j]];
                 if (enables[lang_name,enabledby_name] == "") {
                     enabledby[lang_name,n_enabledby_lang[lang_index]] = enabledby_name;
                     n_enabledby_lang[lang_index]++;
                 }
-                enables[lang_name,enabledby_name] = enables[lang_name,enabledby_name] opts[i] ",";
+                enables[lang_name,enabledby_name] = enables[lang_name,enabledby_name] opts[i] with_args ";";
             }
         }
     }
 }
 
@@ -386,11 +396,11 @@ print "                                 
 print "  switch (code)                                                       "
 print "    {                                                                 "
 for (i = 0; i < n_enabledby; i++) {
     enabledby_name = enabledby[i];
     print "    case " opt_enum(enabledby_name) ":"
-    n_enables = split(enables[enabledby_name], thisenable, ",");
+    n_enables = split(enables[enabledby_name], thisenable, ";");
     for (j = 1; j < n_enables; j++) {
         opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
         if (opt_var_name != "") {
             print "      if (!opts_set->x_" opt_var_name ")"
             print "        handle_generated_option (opts, opts_set,"
@@ -429,20 +439,30 @@ for (i = 0; i < n_langs; i++) {
     print "    {                                                                 "
     
     for (k = 0; k < n_enabledby_lang[i]; k++) {
         enabledby_name = enabledby[lang_name,k];
         print "    case " opt_enum(enabledby_name) ":"
-        n_enables = split(enables[lang_name,enabledby_name], thisenable, ",");
-        for (j = 1; j < n_enables; j++) {
-            opt_var_name = var_name(flags[opt_numbers[thisenable[j]]]);
+        n_thisenable = split(enables[lang_name,enabledby_name], thisenable, ";");
+        for (j = 1; j < n_thisenable; j++) {
+            n_thisenable_args = split(thisenable[j], thisenable_args, ",");
+            if (n_thisenable_args == 1) {
+                thisenable_opt = thisenable[j];
+                value = "value";
+            } else {
+                thisenable_opt = thisenable_args[1];
+                with_posarg = thisenable_args[2];
+                with_negarg = thisenable_args[3];
+                value = "value ? " with_posarg " : " with_negarg;
+            }
+            opt_var_name = var_name(flags[opt_numbers[thisenable_opt]]);
             if (opt_var_name != "") {
                 print "      if (!opts_set->x_" opt_var_name ")"
                 print "        handle_generated_option (opts, opts_set,"
-                print "                                 " opt_enum(thisenable[j]) ", arg, value,"
+                print "                                 " opt_enum(thisenable_opt) ", NULL, " value ","
                 print "                                 lang_mask, kind, loc, handlers, dc);"
             } else {
-                print "#error " thisenable[j] " does not have a Var() flag"
+                print "#error " thisenable_opt " does not have a Var() flag"
             }
         }
         print "      break;\n"
     }
     print "    default:    "
Index: gcc/common.opt
===================================================================
--- gcc/common.opt	(revision 192379)
+++ gcc/common.opt	(working copy)
@@ -607,19 +607,19 @@ Warn if stack usage might be larger than
 Wstrict-aliasing
 Common Warning
 Warn about code which might break strict aliasing rules
 
 Wstrict-aliasing=
-Common Joined RejectNegative UInteger Var(warn_strict_aliasing) Init(-1) Warning
+Common Joined RejectNegative UInteger Var(warn_strict_aliasing) Warning
 Warn about code which might break strict aliasing rules
 
 Wstrict-overflow
 Common Warning
 Warn about optimizations that assume that signed overflow is undefined
 
 Wstrict-overflow=
-Common Joined RejectNegative UInteger Var(warn_strict_overflow) Init(-1) Warning
+Common Joined RejectNegative UInteger Var(warn_strict_overflow) Warning
 Warn about optimizations that assume that signed overflow is undefined
 
 Wsuggest-attribute=const
 Common Var(warn_suggest_attribute_const) Warning
 Warn about functions which might be candidates for __attribute__((const))
