]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/expr.cc: remove Wstrict-overflow from maybe_optimize_sub_cmp_0
authorDaniel Barboza <daniel.barboza@oss.qualcomm.com>
Mon, 25 May 2026 17:52:46 +0000 (14:52 -0300)
committerDaniel Barboza <daniel.barboza@oss.qualcomm.com>
Sun, 31 May 2026 18:51:44 +0000 (15:51 -0300)
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.

gcc/expr.cc
gcc/testsuite/gcc.dg/Wstrict-overflow-25.c [deleted file]

index 47a697ee4da984673f4299b68e61eed77bf4ff86..de73215ccc6623fa90f4a90212fd8dc7c50991a9 100644 (file)
@@ -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 (file)
index 0091644..0000000
+++ /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" } */
-}