[Bug c/106264] [10/11/12/13 Regression] spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result since r9-1295-g781ff3d80e88d7d0

2023-07-18 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106264

--- Comment #9 from Roger Sayle  ---
*** Bug 101090 has been marked as a duplicate of this bug. ***

[Bug c/106264] [10/11/12/13 Regression] spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result since r9-1295-g781ff3d80e88d7d0

2023-07-18 Thread vincent-gcc at vinc17 dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106264

Vincent Lefèvre  changed:

   What|Removed |Added

 CC||vincent-gcc at vinc17 dot net

--- Comment #8 from Vincent Lefèvre  ---
This seems to be the same issue as PR101090 ("incorrect -Wunused-value warning
on remquo with constant values"), which I had reported in 2021 and was present
in GCC 9 too.

[Bug c/106264] [10/11/12/13 Regression] spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result since r9-1295-g781ff3d80e88d7d0

2022-07-20 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106264

Roger Sayle  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
   Target Milestone|10.5|13.0

--- Comment #7 from Roger Sayle  ---
This has now been fixed on mainline for GCC 13.  Please feel free to reopen
this PR if folks consider this problem serious enough to backport the fix to
the release branches.

[Bug c/106264] [10/11/12/13 Regression] spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result since r9-1295-g781ff3d80e88d7d0

2022-07-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106264

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Roger Sayle :

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

commit r13-1741-g40f6e5912288256ee8ac41474f2dce7b6881c111
Author: Roger Sayle 
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  
Richard Biener  

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.

[Bug c/106264] [10/11/12/13 Regression] spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result since r9-1295-g781ff3d80e88d7d0

2022-07-16 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106264

Roger Sayle  changed:

   What|Removed |Added

 CC||roger at nextmovesoftware dot 
com
   Assignee|unassigned at gcc dot gnu.org  |roger at 
nextmovesoftware dot com
 Status|NEW |ASSIGNED

--- Comment #5 from Roger Sayle  ---
Patch proposed:
https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598480.html

[Bug c/106264] [10/11/12/13 Regression] spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result since r9-1295-g781ff3d80e88d7d0

2022-07-15 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106264

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org
   Keywords|needs-bisection |
Summary|[10/11/12/13 Regression]|[10/11/12/13 Regression]
   |spurious -Wunused-value on  |spurious -Wunused-value on
   |a folded frexp, modf, and   |a folded frexp, modf, and
   |remquo calls with unused|remquo calls with unused
   |result  |result since
   ||r9-1295-g781ff3d80e88d7d0

--- Comment #4 from Martin Liška  ---
Yes, started with r9-1295-g781ff3d80e88d7d0.