On Wed, May 27, 2026 at 5:51 AM Daniel Barboza
<[email protected]> wrote:
>
> Remove the single instance of Wstrict-overflow warning and the
> associated testcase.

Ok.

>
> 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                                |  6 ------
>  gcc/testsuite/gcc.dg/Wstrict-overflow-25.c | 11 -----------
>  2 files changed, 17 deletions(-)
>  delete mode 100644 gcc/testsuite/gcc.dg/Wstrict-overflow-25.c
>
> diff --git a/gcc/expr.cc b/gcc/expr.cc
> index 1c68055d45f..9251aa91c80 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 00916446371..00000000000
> --- 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" } */
> -}
> --
> 2.43.0
>

Reply via email to