https://gcc.gnu.org/g:34d559f0fab5d366e99e33a9fc754f9dca96cd51

commit r17-1053-g34d559f0fab5d366e99e33a9fc754f9dca96cd51
Author: Daniel Barboza <[email protected]>
Date:   Mon May 25 14:52:46 2026 -0300

    gcc/expr.cc: remove Wstrict-overflow from maybe_optimize_sub_cmp_0
    
    Remove the single instance of Wstrict-overflow warning and the
    associated testcase.
    
    gcc/ChangeLog:
    
            * expr.cc (maybe_optimize_sub_cmp_0): Removed warning_at () call
            for Wstrict-overflow comparison.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.dg/Wstrict-overflow-25.c: Removed.

Diff:
---
 gcc/expr.cc                                |  6 ------
 gcc/testsuite/gcc.dg/Wstrict-overflow-25.c | 11 -----------
 2 files changed, 17 deletions(-)

diff --git a/gcc/expr.cc b/gcc/expr.cc
index 47a697ee4da9..de73215ccc66 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -13713,12 +13713,6 @@ maybe_optimize_sub_cmp_0 (enum tree_code code, tree 
*arg0, tree *arg1)
   if (!TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (treeop0)))
     return;
 
-  if (issue_strict_overflow_warning (WARN_STRICT_OVERFLOW_COMPARISON))
-    warning_at (gimple_location (stmt), OPT_Wstrict_overflow,
-               "assuming signed overflow does not occur when "
-               "simplifying %<X - Y %s 0%> to %<X %s Y%>",
-               op_symbol_code (code), op_symbol_code (code));
-
   *arg0 = treeop0;
   *arg1 = treeop1;
 }
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-25.c 
b/gcc/testsuite/gcc.dg/Wstrict-overflow-25.c
deleted file mode 100644
index 00916446371a..000000000000
--- a/gcc/testsuite/gcc.dg/Wstrict-overflow-25.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow=3" } */
-
-/* We can only simplify the conditional when using strict overflow
-   semantics.  */
-
-int
-foo (int x, int y)
-{
-  return x - y < 0; /* { dg-warning "assuming signed overflow does not occur" 
"correct warning" } */
-}

Reply via email to