This finishes removing the support for -Wstrict-overflow that seemly was
missed before. It also marks the option as being ignored and fixes
the -Wstrict-overflow= case where it was rejecting -Wstrict-overflow=1 now.

Pushed as obvious after bootstrap/test on x86_64-linux-gnu.

        PR middle-end/125558

gcc/ChangeLog:

        * common.opt (Wstrict-overflow): Mark as Ignore.
        (Wstrict-overflow=): Fix up and mark as igore.
        * gcc-diagnostic-spec.cc (nowarn_spec_t::nowarn_spec_t):
        Remove OPT_Wstrict_overflow.
        * opts.cc (common_handle_option): Likewise.

Signed-off-by: Andrew Pinski <[email protected]>
---
 gcc/common.opt             | 3 ++-
 gcc/gcc-diagnostic-spec.cc | 1 -
 gcc/opts.cc                | 4 ----
 3 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index d816ed6dfb7..218dddf5dfe 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -781,10 +781,11 @@ Common Joined RejectNegative UInteger 
Var(warn_strict_aliasing) Warning
 Warn about code which might break strict aliasing rules.
 
 Wstrict-overflow
-Common Warning
+Common Ignore Warning
 Does nothing.  Preserved for backward compatibility.
 
 Wstrict-overflow=
+Common Ignore Joined RejectNegative UInteger Warning
 Does nothing.  Preserved for backward compatibility.
 
 Wsuggest-attribute=cold
diff --git a/gcc/gcc-diagnostic-spec.cc b/gcc/gcc-diagnostic-spec.cc
index 8c91f81505f..94bbd9e5753 100644
--- a/gcc/gcc-diagnostic-spec.cc
+++ b/gcc/gcc-diagnostic-spec.cc
@@ -59,7 +59,6 @@ nowarn_spec_t::nowarn_spec_t (opt_code opt)
     case OPT_Woverflow:
     case OPT_Wshift_count_negative:
     case OPT_Wshift_count_overflow:
-    case OPT_Wstrict_overflow:
       m_bits = NW_VFLOW;
       break;
 
diff --git a/gcc/opts.cc b/gcc/opts.cc
index 17c54b6688e..342517528e8 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -2951,10 +2951,6 @@ common_handle_option (struct gcc_options *opts,
       set_Wstrict_aliasing (opts, value);
       break;
 
-    case OPT_Wstrict_overflow:
-      /* Deferred.  */
-      break;
-
     case OPT_Wsystem_headers:
       dc->m_warn_system_headers = value;
       break;
-- 
2.43.0

Reply via email to