https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106264

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sa...@gcc.gnu.org>:

https://gcc.gnu.org/g:40f6e5912288256ee8ac41474f2dce7b6881c111

commit r13-1741-g40f6e5912288256ee8ac41474f2dce7b6881c111
Author: Roger Sayle <ro...@nextmovesoftware.com>
Date:   Tue Jul 19 08:39:43 2022 +0100

    PR c/106264: Silence warnings from __builtin_modf et al.

    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 call suppress_warning
    selectively on those COMPOUND_EXPRs that need them.

    2022-07-19  Roger Sayle  <ro...@nextmovesoftware.com>
                Richard Biener  <rguent...@suse.de>

    gcc/ChangeLog
            PR c/106264
            * builtins.cc (fold_builtin_frexp): Call suppress_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.

Reply via email to