On Sat, Jul 16, 2022 at 2:54 PM Roger Sayle <ro...@nextmovesoftware.com> wrote:
>
>
> This middle-end patch resolves PR c/106264 which is a spurious warning
> regression caused by the tree-level expansion of modf, frexp and remquo
> producing "expression has no-effect" when the built-in function's result
> is ignored.  When these built-ins were first expanded at tree-level,
> fold_builtin_n would blindly set TREE_NO_WARNING for all built-ins.
> Now that we're more discerning, we should precisely set TREE_NO_WARNING
> selectively on those COMPOUND_EXPRs that need them.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check with no new failures.  Ok for mainline?

I think you should use

suppress_warning  (res);

I can't think of a specific OPT_Wxyz to use so the end result should
be the same.

OK with that change.

Richard.

> 2022-07-16  Roger Sayle  <ro...@nextmovesoftware.com>
>
> gcc/ChangeLog
>         PR c/106264
>         * builtins.cc (fold_builtin_frexp): Set TREE_NO_WARNING on
>         COMPOUND_EXPR to silence spurious warning if result isn't used.
>         (fold_builtin_modf): Likewise.
>         (do_mpfr_remquo): Likewise.
>
> gcc/testsuite/ChangeLog
>         PR c/106264
>         * gcc.dg/pr106264.c: New test case.
>
>
> Thanks in advance,
> Roger
> --
>

Reply via email to